scene_service.ingest.ros_subscribers¶
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. Topics come from Atlas or observations[] in the config.
Classes
|
The rclpy node, its spin thread and one latest-message slot per kind. |
|
One observation kind (rgb, depth, lidar2d, pose, ...) wired to a ROS topic; qos_profile is the publisher's declaration from Atlas. |
- class scene_service.ingest.ros_subscribers.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.ros_subscribers.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¶