scene_service.ingest¶
Ingest: ROS 2 subscribers and the perception backends that feed the registry.
- class scene_service.ingest.ConceptGraphsDetector(*, rgb_fetcher_msg: Callable[[], Any | None], depth_fetcher_msg: Callable[[], Any | None], camera_info_fetcher: Callable[[], _CamIntrinsics | None], on_detections: Callable[[list[Detection]], Awaitable[None]], registry: ObjectRegistry, world_frame_fn: Callable[[], str] | None = None, robot_base_frame_fn: Callable[[], str] | None = None, period_s: float = 0.6, pose_max_age_s: float = 2.0, confidence_threshold: float = 0.3, max_detections: int = 30, yolo_weights_path: str | None = None, sam_weights_path: str | None = None, clip_model_name: str | None = None, clip_pretrained: str | None = None, cfg_overrides: dict | None = None, hub: Any = None, camera_frame: str = '', base_frame: str | None = None, profile: str = 'lite')[source]¶
Bases:
objectPer-frame detector that runs the canonical concept-graphs merge pipeline.
- async delete_object(object_id: str) None[source]¶
Drop the CG map entries whose uuid is bound to object_id.
- embed_text(texts: list[str]) list[list[float]] | None[source]¶
Encode texts with CLIP, normalized to match object image features.
- latest_detection_views(max_age_s: float = 3.0)[source]¶
(rgb_bgr, [(object_id, (u0, v0, u1, v1))], camera_xy)for the last frame whose detections matched objects, or None.Each box is the one the detector drew for that object in that frame, so the photograph shows what the label was given to.
- class scene_service.ingest.SubscribersHub(specs: list[TopicSpec], *, node_name: str = 'scene_subscribers')[source]¶
Bases:
objectThe rclpy node, its spin thread and one latest-message slot per kind.
- add_spec(spec: TopicSpec) bool[source]¶
Subscribe to a topic that appeared after start(). False when the kind is already known or its message class is unavailable.
- latest(kind: str) tuple[Any, float, int][source]¶
(msg, stamp_unix, count); msg is None until the first message arrives.
- lookup_transform_4x4(target_frame: str, source_frame: str, stamp: Any = None)[source]¶
4x4 transform mapping points from target_frame into source_frame, or None.
stamp (a message header stamp) asks for the transform at that moment: a frame is placed with the pose the robot had when it was captured, not the pose it has once detection on it has finished. Outside the buffered history the latest transform is used, as before.
- class scene_service.ingest.TopicSpec(kind: str, topic: str, msg_type: str, qos_profile: str = 'default')[source]¶
Bases:
objectOne observation kind (rgb, depth, lidar2d, pose, …) wired to a ROS topic; qos_profile is the publisher’s declaration from Atlas.
- kind: str¶
- msg_type: str¶
- qos_profile: str = 'default'¶
- topic: str¶
- class scene_service.ingest.VLMObjectDetector(*, rgb_fetcher: ~typing.Callable[[], bytes | tuple[bytes, int | float] | None], camera_to_world_fn: ~typing.Callable[[], tuple[object, str] | None], on_detections: ~typing.Callable[[list[~scene_service.state.data_assoc.Detection]], ~typing.Awaitable[None]], period_s: float = 3.0, intrinsics: ~scene_service.ingest.perception_vlm._CamIntrinsics | None = None, intrinsics_fn: ~typing.Callable[[], ~scene_service.ingest.perception_vlm._CamIntrinsics | None] | None = None, frame_change_threshold: float | None = None, cache_max_age_s: float | None = None, failure_backoff_base_s: float | None = None, failure_backoff_max_s: float | None = None, clock: ~typing.Callable[[], float] = <built-in function monotonic>)[source]¶
Bases:
objectPolls
rgb_fetcher, asks the VLM, and handsDetectionbatches toon_detections.- property inference_counts: dict[str, int]¶
Modules
Perception routing: which tier and detector Scene runs, from the wired inputs. |
|
ConceptGraphs perception and persistent object-map integration. |
|
VLM object detection: ask an OpenAI-compatible vision model (VLM_BASE_URL, VLM_API_KEY, VLM_MODEL) for the objects in an RGB frame and project them into the world frame. |
|
ROS 2 ingest: an rclpy node on its own thread keeps the latest message of each observation kind in a thread-safe slot that asyncio code reads on its own schedule. |