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, relations[, hub, ...])

Build the Starlette ASGI app the entrypoint mounts on its own uvicorn server.

scene_service.web.make_app(*, registry: ObjectRegistry, relations: RelationEngine, hub: Any = None, detector: Any = None, sg_store: Any = None) Starlette[source]

Build the Starlette ASGI app the entrypoint mounts on its own uvicorn server.

Routes:

GET / — 2D top-down map (occupancy grid + objects) GET /3d — 3D scene (point clouds + bbox; three.js) GET /api/state — JSON for the 2D map GET /api/objects3d — JSON for the 3D viz (per-object pcd + bbox)

hub is the SubscribersHub — passed so the JSON state can include the latest OccupancyGrid for the 2D canvas underlay. detector is the ConceptGraphsDetector — passed so the 3D endpoint can serialize its persistent MapObjectList. If None, the 3D page just shows an empty world.