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

SubscribersHub(specs, *[, node_name])

The rclpy node, its spin thread and one latest-message slot per kind.

TopicSpec(kind, topic, msg_type[, qos_profile])

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: object

The 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.

has(kind: str) → bool[source]
has_kinds() → set[str][source]
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.

async start() → None[source]
async stop() → None[source]
class scene_service.ingest.ros_subscribers.TopicSpec(kind: str, topic: str, msg_type: str, qos_profile: str = 'default')[source]

Bases: object

One 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
scene_service.ingest.ros_subscribers.topic_qos_policy(spec: TopicSpec) → tuple[str, str, int][source]

Reliability, durability and depth for one topic. Follows the publisher’s declaration: a RELIABLE request cannot connect to a BEST_EFFORT publisher.