Skip to content

Commit 7448e79

Browse files
committed
add localization uncertainty recovery example
Add examples/navigation/10_localization_uncertainty_recovery.py. The robot wakes up with a bimodal pose belief over two mirror cells that produce identical landmark distances. The agent detects the high entropy, drives toward the symmetric landmark to break the ambiguity, then switches one-way to A* goal navigation after the belief collapses. Cover the loop with a smoke test asserting success, recovery_count >= 1, final entropy below threshold, and that both localize and go_to_goal states appear in the trace. Register a GIF maker and the rendered GIF. Update README, examples/README.md, examples/navigation/README.md, docs/learning_paths.md, docs/status.md, and docs/plan.md to reflect the new example, GIF, and test counts (23 examples, 22 GIFs, 65 tests).
1 parent f2e0a20 commit 7448e79

10 files changed

Lines changed: 655 additions & 26 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ robotics loops rather than standalone algorithms.
1111

1212
## Current Status
1313

14-
- 22 runnable examples
14+
- 23 runnable examples
1515
- 20 learning-path roadmap examples
16-
- 21 README GIFs generated from runnable examples
17-
- 59 smoke and regression tests
16+
- 22 README GIFs generated from runnable examples
17+
- 65 smoke and regression tests
1818
- Core dependencies only: `numpy` and `matplotlib`
1919

2020
See `docs/status.md` for the implementation snapshot and `docs/plan.md` for
@@ -118,9 +118,9 @@ These GIFs are generated from the runnable examples, not separate animations.
118118
| --- | --- |
119119
| ![A grid robot reduces pose and map uncertainty with active sensing.](docs/assets/gifs/active_slam_toy.gif) | ![A point robot repeatedly replans short-horizon controls around a moving obstacle.](docs/assets/gifs/interactive_mpc.gif) |
120120

121-
| Blocked path recovery |
122-
| --- |
123-
| ![A grid robot detects a newly blocked path, steps back, marks the blocked cell, and replans.](docs/assets/gifs/blocked_path_recovery.gif) |
121+
| Blocked path recovery | Localization uncertainty recovery |
122+
| --- | --- |
123+
| ![A grid robot detects a newly blocked path, steps back, marks the blocked cell, and replans.](docs/assets/gifs/blocked_path_recovery.gif) | ![A grid robot starts with a bimodal pose belief, drives toward a landmark to break the symmetry, then navigates to the goal.](docs/assets/gifs/localization_uncertainty_recovery.gif) |
124124

125125
### Embodied AI
126126

151 KB
Loading

docs/learning_paths.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
4. `examples/navigation/06_belief_based_navigation.py`
1717
5. `examples/navigation/07_active_slam_toy.py`
1818
6. `examples/navigation/08_interactive_mpc.py`
19+
7. `examples/navigation/10_localization_uncertainty_recovery.py`
1920

2021
## Manipulation Intelligence
2122

docs/plan.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ first-run experience small, fast, and failure-aware.
88

99
The repository currently has:
1010

11-
- 22 runnable examples
11+
- 23 runnable examples
1212
- 20 numbered learning-path examples
13-
- 2 extra examples outside the original learning-path roadmap
14-
- 21 generated README GIFs
15-
- 59 smoke and regression tests
13+
- 3 extra examples outside the original learning-path roadmap
14+
- 22 generated README GIFs
15+
- 65 smoke and regression tests
1616
- GitHub Actions CI for Python 3.10, 3.11, and 3.12
1717
- core dependencies limited to `numpy` and `matplotlib`
1818
- optional Gymnasium-style adapters for `GridWorld2D`,
@@ -81,6 +81,10 @@ Recent completed work:
8181
- Focused adapter tests were added covering reset shape, step shape, action
8282
decoding, success termination, timeout truncation, and recoverable
8383
`blocked_path` failure.
84+
- `examples/navigation/10_localization_uncertainty_recovery.py` was added.
85+
The agent wakes up with a bimodal pose belief, takes information actions
86+
toward the symmetric landmark, then switches one-way to goal navigation
87+
after the belief collapses. A GIF and smoke test cover the loop.
8488

8589
The next agent should not redo those items. If any of them seem missing, first
8690
check the current branch and latest pulled commit.
@@ -89,8 +93,9 @@ Recommended next task:
8993

9094
1. Pick the next adapter or example from the "Next candidates" list under
9195
Priority 3 and Priority 4. A continuous-control wrapper such as
92-
`MovingObstacleWorld`, or `examples/navigation/10_localization_uncertainty_recovery.py`,
93-
are both reasonable next steps.
96+
`MovingObstacleWorld`, or a manipulation belief-grasp example
97+
(`examples/manipulation/08_belief_grasp_selection.py`) are both reasonable
98+
next steps.
9499
2. Keep the package/example boundary the same as the `BlockedPathWorld` work:
95100
environment in `pir/worlds/`, agent + policy + run loop in the example.
96101
3. Adapter tests should be added before broadening the adapter API further.
@@ -226,21 +231,25 @@ Acceptance criteria:
226231

227232
### Priority 4: Add The Next Example Tier
228233

229-
Goal: grow from 22 examples toward 30 examples without losing readability.
234+
Goal: grow from 23 examples toward 30 examples without losing readability.
235+
236+
Already done from the previous tier:
237+
238+
- `examples/navigation/10_localization_uncertainty_recovery.py` — pose
239+
uncertainty -> information action -> resume goal navigation.
230240

231241
Recommended next examples:
232242

233243
| Priority | Example | Area | Loop |
234244
| --- | --- | --- | --- |
235-
| 1 | `examples/navigation/10_localization_uncertainty_recovery.py` | navigation | pose uncertainty -> information action -> recover |
236-
| 2 | `examples/manipulation/08_belief_grasp_selection.py` | manipulation | pose belief -> grasp choice -> failure update |
237-
| 3 | `examples/manipulation/09_active_viewpoint_for_grasp.py` | manipulation | choose view -> reduce occlusion -> grasp |
238-
| 4 | `examples/embodied_ai/21_object_permanence_toy.py` | embodied AI | object disappears -> memory persists -> search |
239-
| 5 | `examples/embodied_ai/22_where_did_i_see_it.py` | embodied AI | memory query -> revisit place -> act |
240-
| 6 | `examples/world_models/23_model_error_recovery.py` | world model | prediction failure -> update model -> recover |
241-
| 7 | `examples/navigation/24_information_gain_navigation.py` | navigation | goal progress vs information gain |
242-
| 8 | `examples/manipulation/25_clear_path_before_pick.py` | manipulation | precondition failure -> clear obstacle -> pick |
243-
| 9 | `examples/navigation/27_multi_agent_avoidance.py` | navigation | observe agents -> avoid -> replan |
245+
| 1 | `examples/manipulation/08_belief_grasp_selection.py` | manipulation | pose belief -> grasp choice -> failure update |
246+
| 2 | `examples/manipulation/09_active_viewpoint_for_grasp.py` | manipulation | choose view -> reduce occlusion -> grasp |
247+
| 3 | `examples/embodied_ai/21_object_permanence_toy.py` | embodied AI | object disappears -> memory persists -> search |
248+
| 4 | `examples/embodied_ai/22_where_did_i_see_it.py` | embodied AI | memory query -> revisit place -> act |
249+
| 5 | `examples/world_models/23_model_error_recovery.py` | world model | prediction failure -> update model -> recover |
250+
| 6 | `examples/navigation/24_information_gain_navigation.py` | navigation | goal progress vs information gain |
251+
| 7 | `examples/manipulation/25_clear_path_before_pick.py` | manipulation | precondition failure -> clear obstacle -> pick |
252+
| 8 | `examples/navigation/27_multi_agent_avoidance.py` | navigation | observe agents -> avoid -> replan |
244253

245254
Selection rule:
246255

docs/status.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ see what exists, what is verified, and what should come next.
55

66
## Snapshot
77

8-
- Runnable examples: 22
8+
- Runnable examples: 23
99
- Learning-path roadmap examples: 20
10-
- README GIFs: 21
11-
- Smoke and regression tests: 59
10+
- README GIFs: 22
11+
- Smoke and regression tests: 65
1212
- Core dependencies: `numpy`, `matplotlib`
1313
- Contributor extra: `pip install -e ".[dev]"`
1414
- CI: Python 3.10, 3.11, 3.12
@@ -29,7 +29,7 @@ goal-command example. The numbered 20-example roadmap is tracked in
2929
| Area | Examples | Main concepts |
3030
| --- | ---: | --- |
3131
| Runtime | 2 | smallest observe-act-observe loop, trace replay |
32-
| Navigation | 8 | reactive avoidance, dynamic obstacles, replanning, exploration, belief, active SLAM, MPC, recovery |
32+
| Navigation | 9 | reactive avoidance, dynamic obstacles, replanning, exploration, belief, active SLAM, MPC, recovery, localization recovery |
3333
| Manipulation | 7 | retry, reactive grasping, IK servo, moving target reaching, search, push recovery, suction sorting |
3434
| Embodied AI | 4 | controlled goals, memory, POMDP search, tiny VLA loop |
3535
| World models | 1 | action-conditioned dynamics, prediction error, model update, replanning |

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Run any example headless with its `--no-render` flag when available.
2424
| `navigation/07_active_slam_toy.py` | `python examples/navigation/07_active_slam_toy.py` | act to reduce map and pose uncertainty |
2525
| `navigation/08_interactive_mpc.py` | `python examples/navigation/08_interactive_mpc.py` | predict -> control -> replan |
2626
| `navigation/09_blocked_path_recovery.py` | `python examples/navigation/09_blocked_path_recovery.py` | detect blocked path -> recover -> replan |
27+
| `navigation/10_localization_uncertainty_recovery.py` | `python examples/navigation/10_localization_uncertainty_recovery.py` | ambiguous pose -> information action -> resume goal |
2728

2829
## Manipulation
2930

0 commit comments

Comments
 (0)