Skip to content

Commit 8d3ca01

Browse files
committed
Add household task agent demo
1 parent 0a67481 commit 8d3ca01

17 files changed

Lines changed: 1129 additions & 27 deletions

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ flagship loops directly in Colab:
1616
[safety filter](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/safety_filter_cbf.ipynb), and
1717
[human correction replanning](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/human_correction_replanning.ipynb).
1818
For language ambiguity, try
19-
[clarifying question](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/clarifying_question.ipynb).
19+
[clarifying question](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/clarifying_question.ipynb), or run the integrated
20+
[household task agent](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/household_task_agent.ipynb).
2021
If the project helps you teach, prototype, or explain robotics loops, a GitHub
2122
star helps others find it.
2223

@@ -51,10 +52,11 @@ python3 examples/runtime/01_sense_act_loop.py
5152
| Active perception | `python3 examples/navigation/07_active_slam_toy.py` | map and pose uncertainty -> information-seeking action |
5253
| Human correction | [Open in Colab](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/human_correction_replanning.ipynb) | shortcut -> human correction -> cost update -> replan |
5354
| Language ambiguity | [Open in Colab](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/clarifying_question.ipynb) | ambiguous command -> ask question -> answer -> act |
55+
| Integrated household task | [Open in Colab](https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/household_task_agent.ipynb) | clarify -> plan -> safety check -> retry -> human replan |
5456

5557
## Status
5658

57-
38 runnable examples · 37 README GIFs · 107 smoke / regression tests ·
59+
39 runnable examples · 38 README GIFs · 109 smoke / regression tests ·
5860
5 Gymnasium-style adapters · CI green on Python 3.10, 3.11, and 3.12.
5961

6062
See `docs/status.md` for the implementation snapshot, `docs/plan.md` for the
@@ -161,9 +163,9 @@ These GIFs are generated from the runnable examples, not separate animations.
161163
| --- | --- |
162164
| ![A kitchen agent parses a bring goal, searches containers, handles a closed cabinet, picks a mug, and places it on the table.](docs/assets/gifs/goal_conditioned_minikitchen.gif) | ![A toy VLA loop parses a language goal, reads visual tokens, picks from low confidence, recovers with a close view, and places the block.](docs/assets/gifs/tiny_vla_loop.gif) |
163165

164-
| Clarifying question |
165-
| --- |
166-
| ![A tabletop robot receives the ambiguous command pick the block, asks which block, receives a red answer, resolves the goal, and picks the red block.](docs/assets/gifs/clarifying_question.gif) |
166+
| Clarifying question | Household task agent |
167+
| --- | --- |
168+
| ![A tabletop robot receives the ambiguous command pick the block, asks which block, receives a red answer, resolves the goal, and picks the red block.](docs/assets/gifs/clarifying_question.gif) | ![A household robot asks which block to put away, plans through a room, rejects an unsafe floor step, retries a missed grasp, accepts human correction, replans, and stores the block.](docs/assets/gifs/household_task_agent.gif) |
167169

168170
| Object permanence toy |
169171
| --- |
84.8 KB
Loading

docs/index.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1>Python<wbr>Interactive<wbr>Robotics</h1>
6262
>Star on GitHub</a>
6363
<a
6464
class="action-link"
65-
href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/human_correction_replanning.ipynb"
65+
href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/household_task_agent.ipynb"
6666
>Open in Colab</a>
6767
<a class="action-link" href="#run">Run the first loop</a>
6868
<a class="action-link secondary" href="#loops">See the examples</a>
@@ -73,15 +73,15 @@ <h1>Python<wbr>Interactive<wbr>Robotics</h1>
7373
<section class="stats" aria-label="Project snapshot">
7474
<div class="stats-inner">
7575
<div class="stat">
76-
<strong>38</strong>
76+
<strong>39</strong>
7777
<span>runnable examples</span>
7878
</div>
7979
<div class="stat">
80-
<strong>37</strong>
80+
<strong>38</strong>
8181
<span>generated GIFs</span>
8282
</div>
8383
<div class="stat">
84-
<strong>107</strong>
84+
<strong>109</strong>
8585
<span>smoke and regression tests</span>
8686
</div>
8787
<div class="stat">
@@ -123,6 +123,7 @@ <h2>Run in Colab</h2>
123123
<a href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/safety_filter_cbf.ipynb">Safety filter CBF</a>
124124
<a href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/human_correction_replanning.ipynb">Human correction replanning</a>
125125
<a href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/clarifying_question.ipynb">Clarifying question</a>
126+
<a href="https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/household_task_agent.ipynb">Household task agent</a>
126127
</div>
127128
</div>
128129
</section>
@@ -235,6 +236,18 @@ <h3>Clarifying question</h3>
235236
</figcaption>
236237
</figure>
237238

239+
<figure class="loop-card">
240+
<img
241+
src="assets/gifs/household_task_agent.gif"
242+
alt="A household robot clarifies an ambiguous command, replans around unsafe and human-corrected zones, retries a grasp, and stores the block."
243+
>
244+
<figcaption>
245+
<h3>Household task agent</h3>
246+
<p>clarify -> plan -> safety check -> retry -> human replan</p>
247+
<a href="https://github.com/rsasaki0109/PythonInteractiveRobotics/blob/main/examples/embodied_ai/36_household_task_agent.py">Open example</a>
248+
</figcaption>
249+
</figure>
250+
238251
<figure class="loop-card">
239252
<img
240253
src="assets/gifs/conformal_ask_for_help.gif"

docs/learning_paths.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
7. `examples/embodied_ai/32_empowerment_navigation.py`
4949
8. `examples/embodied_ai/33_inverse_reward_from_demo.py`
5050
9. `examples/embodied_ai/35_clarifying_question.py`
51-
10. `examples/world_models/20_tiny_world_model_planning.py`
52-
11. `examples/world_models/23_model_error_recovery.py`
51+
10. `examples/embodied_ai/36_household_task_agent.py`
52+
11. `examples/world_models/20_tiny_world_model_planning.py`
53+
12. `examples/world_models/23_model_error_recovery.py`
5354

5455
See `docs/goal_commands.md` for the first controlled-language command set.

docs/plan.md

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

99
The repository currently has:
1010

11-
- 38 runnable examples
11+
- 39 runnable examples
1212
- 20 numbered learning-path examples
13-
- 18 extra examples outside the original learning-path roadmap
14-
- 37 generated README GIFs
15-
- 107 smoke and regression tests
16-
- 4 Colab notebooks for browser-first demos
13+
- 19 extra examples outside the original learning-path roadmap
14+
- 38 generated README GIFs
15+
- 109 smoke and regression tests
16+
- 5 Colab notebooks for browser-first demos
1717
- GitHub Actions CI for Python 3.10, 3.11, and 3.12
1818
- core dependencies limited to `numpy` and `matplotlib`
1919
- optional Gymnasium-style adapters for `GridWorld2D`,
@@ -148,6 +148,11 @@ Recent completed work:
148148
simulated answer, updates its structured goal, confirms the target visually,
149149
and picks the requested block. GIF, smoke tests, failure contract test, and a
150150
Colab notebook cover the loop.
151+
- `examples/embodied_ai/36_household_task_agent.py` was added. The agent gets
152+
the ambiguous command `put the block away`, asks which block, plans to it,
153+
rejects an unsafe floor step, replans, retries a missed grasp, accepts human
154+
correction during delivery, replans again, and stores the block. GIF, smoke
155+
test, failure contract test, and a Colab notebook cover the loop.
151156
- `MovingObstacleWorld` was extracted from `examples/navigation/08_interactive_mpc.py`
152157
into `pir/worlds/moving_obstacle.py`, and `MovingObstacleWorldGymnasiumAdapter`
153158
was added in `pir/adapters/gymnasium_adapter.py`. The adapter exposes a

docs/public_launch.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ Use this longer description when space allows:
4949
workflow is on `main`.
5050
- [x] Add Colab notebooks:
5151
`pick_and_retry`, `safety_filter_cbf`,
52-
`human_correction_replanning`, and `clarifying_question`
52+
`human_correction_replanning`, `clarifying_question`, and
53+
`household_task_agent`
5354
([#4](https://github.com/rsasaki0109/PythonInteractiveRobotics/issues/4)).
5455
- [x] Add copyable public-launch post snippets
5556
([#5](https://github.com/rsasaki0109/PythonInteractiveRobotics/issues/5)).
@@ -69,6 +70,7 @@ Good first posts:
6970
- `language goal -> visual tokens -> skill failure -> close-view retry`
7071
- `shortcut -> human correction -> cost update -> replan`
7172
- `ambiguous command -> ask question -> answer -> act`
73+
- `clarify -> plan -> safety check -> retry -> human replan`
7274

7375
Target channels:
7476

@@ -186,6 +188,26 @@ GIF: `docs/assets/gifs/clarifying_question.gif`
186188
Colab:
187189
`https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/clarifying_question.ipynb`
188190

191+
### Household Task Agent
192+
193+
One small task trace combines language grounding, planning, safety, grasp
194+
retry, and human correction:
195+
196+
```text
197+
put the block away -> Which block? -> plan -> safety check -> retry -> replan -> place
198+
```
199+
200+
Run it:
201+
202+
```bash
203+
python3 examples/embodied_ai/36_household_task_agent.py "put the block away" --answer red
204+
```
205+
206+
GIF: `docs/assets/gifs/household_task_agent.gif`
207+
208+
Colab:
209+
`https://colab.research.google.com/github/rsasaki0109/PythonInteractiveRobotics/blob/main/notebooks/household_task_agent.ipynb`
210+
189211
## Contributor Funnel
190212

191213
Keep public issues small and specific. Good first issues should improve an

docs/status.md

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

66
## Snapshot
77

8-
- Runnable examples: 38
8+
- Runnable examples: 39
99
- Learning-path roadmap examples: 20
10-
- README GIFs: 37
11-
- Smoke and regression tests: 107 (94 example/adapter + 13 planning)
12-
- Colab notebooks: 4
10+
- README GIFs: 38
11+
- Smoke and regression tests: 109 (96 example/adapter + 13 planning)
12+
- Colab notebooks: 5
1313
- Core dependencies: `numpy`, `matplotlib`
1414
- Contributor extra: `pip install -e ".[dev]"`
1515
- CI: Python 3.10, 3.11, 3.12
@@ -22,7 +22,7 @@ see what exists, what is verified, and what should come next.
2222
`BlockedPathWorldGymnasiumAdapter`, `MovingObstacleWorldGymnasiumAdapter`
2323
- Shared grid-planning module: `pir.planning.astar`,
2424
`pir.planning.bfs_reachable_count`, `pir.planning.manhattan` -
25-
imported by eleven examples (04, 05, 06, 09, 10, 24, 27, 28, 32, 33, 34)
25+
imported by twelve examples (04, 05, 06, 09, 10, 24, 27, 28, 32, 33, 34, 36)
2626

2727
`examples/embodied_ai/01_goal_command_pick.py` is an extra flagship
2828
goal-command example. The numbered 20-example roadmap is tracked in
@@ -35,7 +35,7 @@ goal-command example. The numbered 20-example roadmap is tracked in
3535
| Runtime | 2 | smallest observe-act-observe loop, trace replay |
3636
| Navigation | 14 | reactive avoidance, dynamic obstacles, replanning, exploration, belief, active SLAM, MPC, recovery, localization recovery, information-gain detour, multi-agent avoidance, CBF safety filter, options with interrupts, human correction replanning |
3737
| Manipulation | 11 | retry, reactive grasping, IK servo, moving target reaching, search, push recovery, suction sorting, belief grasp selection, active viewpoint grasp, clear path before pick, conformal ask-for-help |
38-
| Embodied AI | 9 | controlled goals, memory, POMDP search, tiny VLA loop, object permanence, curiosity exploration, empowerment shaping, inverse reward from demo, clarifying questions |
38+
| Embodied AI | 10 | controlled goals, memory, POMDP search, tiny VLA loop, object permanence, curiosity exploration, empowerment shaping, inverse reward from demo, clarifying questions, integrated household tasks |
3939
| World models | 2 | action-conditioned dynamics, prediction error, model update, replanning, regime-shift detection, system identification |
4040

4141
## Verification

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Run any example headless with its `--no-render` flag when available.
6060
| `embodied_ai/32_empowerment_navigation.py` | `python examples/embodied_ai/32_empowerment_navigation.py` | k-step empowerment -> shaped A* -> prefer open routes |
6161
| `embodied_ai/33_inverse_reward_from_demo.py` | `python examples/embodied_ai/33_inverse_reward_from_demo.py` | demo feature expectation -> learned weights -> shaped A* to new goal |
6262
| `embodied_ai/35_clarifying_question.py` | `python examples/embodied_ai/35_clarifying_question.py "pick the block" --answer red` | ambiguous command -> ask question -> answer -> act |
63+
| `embodied_ai/36_household_task_agent.py` | `python examples/embodied_ai/36_household_task_agent.py "put the block away" --answer red` | clarify -> plan -> safety check -> retry -> human replan |
6364

6465
## World Models
6566

0 commit comments

Comments
 (0)