scene_service.map_binding

Which map scene is bound to.

Mapping’s latched lifecycle broadcast wins; the manifest’s map_id, then SCENE_MAP_ID, then “default” cover a mapping that is not up yet or does not broadcast. generation is mapping’s map-frame epoch; the watcher in service.py flushes derived objects when it changes.

Functions

choose_map_binding(broadcast, config_map_id, ...)

broadcast > config.map_id > SCENE_MAP_ID > "default".

read_latched_lifecycle(topic, timeout_s)

One read of the latched MapLifecycle sample, on a private rclpy context so the hub's later rclpy.init() does not clash.

sanitize_map_id(raw)

A map id safe as a directory name and URL segment; all-dot names become "default" because "." and ".." name existing directories.

Classes

MapBinding(map_id, source[, mode, generation])

The resolved binding and where it came from.

class scene_service.map_binding.MapBinding(map_id: str, source: str, mode: str = '', generation: int | None = None)[source]

Bases: object

The resolved binding and where it came from.

generation: int | None = None
map_id: str
mode: str = ''
source: str
scene_service.map_binding.choose_map_binding(broadcast: dict | None, config_map_id: object, env_map_id: str | None) → MapBinding[source]

broadcast > config.map_id > SCENE_MAP_ID > “default”. A broadcast with an empty map_id (mapping runs without a named map) counts as none.

scene_service.map_binding.read_latched_lifecycle(topic: str, timeout_s: float) → dict | None[source]

One read of the latched MapLifecycle sample, on a private rclpy context so the hub’s later rclpy.init() does not clash. None on timeout or when rclpy / the ros2_idl overlay is missing.

scene_service.map_binding.sanitize_map_id(raw: str | None) → str[source]

A map id safe as a directory name and URL segment; all-dot names become “default” because “.” and “..” name existing directories.