Skip to content

Add goto <zone> and optional zone footprints ("go to the kitchen")#46

Open
MJohnson459 wants to merge 1 commit into
mainfrom
worktree-feat+named-regions
Open

Add goto <zone> and optional zone footprints ("go to the kitchen")#46
MJohnson459 wants to merge 1 commit into
mainfrom
worktree-feat+named-regions

Conversation

@MJohnson459

@MJohnson459 MJohnson459 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Adds place-based navigation — goto <zone> ("go to the kitchen") — to the task layer.

One concept: a "zone"

Review feedback on the first cut was that zones and regions were two names for the same thing — a named pose you navigate to — and that a zones.yaml holding both was confusing. So this collapses them into a single concept:

  • A zone is a named pose the robot navigates to. fetch (its pickup/dropoff waypoints) and goto <zone> both resolve names against the one zones: table — goto kitchen, goto home, any zone works.
  • A zone may carry an optional area footprint (a radius circle) that turns it into a room and answers "am I inside it?" (zones.containing()). The footprint is optional metadata on the single concept — not a second type — so there's one YAML section, one loader, one teach command.
frame_id: map
zones:
  pickup:  {x: 1.8, y: -1.5, yaw: 0.0}      # bare waypoint
  kitchen: {x: 2.0, y: 2.0, radius: 1.5}    # room: pose + circular footprint

The footprint is deliberately extensible: Zone.footprint is selected in one place (_footprint()), so a polygon: (explicit vertices, e.g. from map room-detection) slots into the same seam later — see follow-ups below.

Changes

  • mote_tasks/zones.pyload_zones{name: Zone(name, pose, footprint)}; Circle footprint with a clear seam for a future Polygon; containing() membership query (nearest-pose first); append_zone/save_zone gain an optional --radius.
  • trees/goto.py + trees/common.py (shared WaitForTask + the task blackboard key). task_server hosts both the fetch and goto trees and dispatches on the command's first word (fetch/goto; unknown rejected), publishing accepted/succeeded/failed on task/status.
  • Sites — zones (with optional footprints) live in the floor's zones.yaml, resolved via sites.py; site info shows N zones, M with a footprint.
  • Sim worlds gain a few room zones (mote_world/office_world by hand; hospital_world via gen_hospital.py, regenerated — SDF byte-identical, single zone-clearance assertion). The default fallback zones.default.yaml mirrors mote_world so goto kitchen works out of the box.
  • Docs — CLAUDE.md + mote_tasks/README.md rewritten around the single concept.

Testing

  • pixi run lint, pixi run build, pixi run test (97 tests, 0 failures), pixi run sim-test — all green.
  • New unit tests: test_goto_command (parser), test_goto_tree (full goto tick + dispatch against a mock navigate_to_pose), and test_zones extended to cover footprints and containing().
  • Live headless sim on this code: goto kitchen drove the robot to the room and reported succeeded: goto kitchen on two worldsoffice_world.sdf and mote_world.sdf.

Follow-ups (out of scope here)

  • Polygon footprints beyond circles (#174).
  • Auto-segment a saved map into room zones (#175).

🤖 Generated with Claude Code

Adds place-based navigation ("go to the kitchen") to the task layer. Rather
than a separate "region" concept, this treats a named place as one thing — a
**zone** — since a zone and a region are both just a named pose you navigate
to. A zone is a pose (a fetch waypoint or a `goto <zone>` target) that MAY
carry an optional area **footprint**, which turns it into a room and answers
"am I inside it". `goto` and `fetch` resolve names against the one zones table.

- mote_tasks/zones.py: load_zones returns {name: Zone(name, pose, footprint)}.
  The footprint is a Circle (`radius`) today, chosen in _footprint() with a
  clear seam for a Polygon once map room-detection can emit one; containing()
  is the "which zone am I in" membership query. append_zone/save_zone gain an
  optional --radius.
- mote_tasks/trees/goto.py + trees/common.py (shared WaitForTask + task key):
  task_server hosts both the fetch and goto trees and dispatches on the command
  word (fetch/goto; unknown rejected), publishing accepted/succeeded/failed.
- Sites: zones (with optional footprints) still live in the floor's zones.yaml,
  resolved via sites.py; `site info` shows "N zones, M with a footprint".
- Sim worlds gain a few room zones (mote/office by hand, hospital via
  gen_hospital.py — regenerated, SDF byte-identical, single zone-clearance
  check). Default fallback zones config mirrors mote_world so goto works out of
  the box.
- Tests: test_goto_command + test_goto_tree (mock-nav goto tick and dispatch);
  test_zones covers footprints and containing(). Docs: CLAUDE.md + mote_tasks
  README.

Verified: pixi run lint / build / test (97 tests) and sim-test all green;
`goto kitchen` drives the robot to the room and reports succeeded in headless
sim on office_world and mote_world. Polygon footprints and auto-segmenting a
map into room zones are tracked follow-ups.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGJYBaS79BFJdnxf2uyCnS
@MJohnson459
MJohnson459 force-pushed the worktree-feat+named-regions branch from ea58047 to f22be48 Compare July 23, 2026 22:33
@MJohnson459 MJohnson459 changed the title Named regions: 'go to the kitchen' via Site region labels Add goto <zone> and optional zone footprints ("go to the kitchen") Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant