Stand-in for `rospy.Subscriber`, wrapping the creation of ROS2 subscription.
More...
|
| __new__ (cls, name, data_class, callback=None, callback_args=None, queue_size=None, buff_size=None, tcp_nodelay=None) |
| Returns rclpy.subscription.Subscription instance, supporting `AnyMsg`.
|
|
| __subclasshook__ (cls, C) |
| Returns true if C is a ROS2 subscription class, else `NotImplemented`.
|
|
Stand-in for `rospy.Subscriber`, wrapping the creation of ROS2 subscription.
Definition at line 71 of file topics.py.
◆ __new__()
rosros.rospify.topics.Subscriber.__new__ |
( |
|
cls, |
|
|
|
name, |
|
|
|
data_class, |
|
|
|
callback = None , |
|
|
|
callback_args = None , |
|
|
|
queue_size = None , |
|
|
|
buff_size = None , |
|
|
|
tcp_nodelay = None |
|
) |
| |
Returns rclpy.subscription.Subscription instance, supporting `AnyMsg`.
- Parameters
-
name | graph resource name of topic, e.g. 'laser' |
data_class | data type class to use for messages, e.g. std_msgs.msg.String |
callback | function to call ( fn(data)) when data is received. If callback_args is set, the function must accept the callback_args as a second argument, i.e. fn(data, callback_args). |
- Note
- Additional callbacks can be added using add_callback().
- Parameters
-
callback_args | additional arguments to pass to the callback. This is useful when you wish to reuse the same callback for multiple subscriptions. |
queue_size | maximum number of messages to receive at a time. This will generally be 1 or None (infinite, default). |
buff_size | ignored (ROS1 compatibility stand-in) |
tcp_nodelay | ignored (ROS1 compatibility stand-in) |
Definition at line 93 of file topics.py.
◆ __subclasshook__()
rosros.rospify.topics.Subscriber.__subclasshook__ |
( |
|
cls, |
|
|
|
C |
|
) |
| |
Returns true if C is a ROS2 subscription class, else `NotImplemented`.
Definition at line 111 of file topics.py.
The documentation for this class was generated from the following file: