scene_service.web

Tiny live web UI for scene — top-down 2D canvas of objects + robot, plus a side panel listing every tracked object. Single static HTML served from /, JSON state at /api/state polled by the page at 5 Hz.

Bound on a separate port from FastMCP (default 50107) so the LLM / pilot path and the human-debug path don’t share a uvicorn — they have different latency tolerance and stop semantics. Lives in the same asyncio loop as the rest of scene though, so reading _REGISTRY is cheap (no IPC).

What it does NOT show yet: 3D pose Z, surface bbox extents, mapping service’s occupancy grid (mapping isn’t deployed yet — once it is, the JSON will grow an occupancy: field that the canvas overlays).

Functions

make_app(*, registry[, hub, detector, ...])

The Scene web app: the pages, /api/state, region CRUD and the map library façade over robonix/service/map.

scene_service.web.make_app(*, registry: ObjectRegistry, hub: Any = None, detector: Any = None, sg_store: Any = None, anno_store: Any = None, object_store: Any = None, map_meta: Any = None, map_binding: dict | None = None, ops_lock: Lock | None = None, semantic_hold: dict | None = None, robot_geometry: Any = None, object_mutations: Any = None, object_views: Any = None, rerun_sink: Any = None) → Starlette[source]

The Scene web app: the pages, /api/state, region CRUD and the map library façade over robonix/service/map.

Region API (see system/scene/README.md): GET/POST /api/regions, PUT/DELETE /api/regions/{id}. PUT merges any of name, points, theta and stale: false; theta is poi-only. Errors are {ok: false, detail} with 400 (bad input), 404 (unknown id) or 503 (no store); a failed store write is a plain 500 on purpose. No authentication: this is a LAN debug server.

map_binding is the mutable {map_id, mode, generation, source} shared with the lifecycle watcher, and ops_lock serialises Save/Load/Delete with it. object_store + map_meta hold each saved map’s object snapshot; without map_meta, Save/Load cover regions only.

scene_service.web.occupancy_payload(hub: Any) → dict | None[source]

The latest OccupancyGrid as a grayscale PNG plus its geometry, or None when there is no map yet or it cannot be rendered.