rclpy.experimental.async_subscription module
- class rclpy.experimental.async_subscription.AsyncSubscription(subscription_impl: object, msg_type: Type[MsgT], topic: str, callback: Callable[[MsgT], None] | Callable[[MsgT, MessageInfo], None] | Callable[[MsgT], Awaitable[None]] | Callable[[MsgT, MessageInfo], Awaitable[None]] | Callable[[bytes], None] | Callable[[bytes, MessageInfo], None] | Callable[[bytes], Awaitable[None]] | Callable[[bytes, MessageInfo], Awaitable[None]], qos_profile: rclpy.qos.QoSProfile, on_destroy: Callable[[AsyncSubscription], None], raw: bool = False, concurrent: bool = False, tg: TaskGroup | None = None)
Bases:
BaseSubscription[MsgT]A subscription to a ROS topic.
Experimental
This API is experimental.
Create a container for a ROS subscription.
Warning
Users should not create a subscription with this constructor, instead they should call
Node.create_subscription()orAsyncNode.create_subscription().