rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
Loading...
Searching...
No Matches
rosros.rospify.topics.Subscriber Class Reference

Stand-in for `rospy.Subscriber`, wrapping the creation of ROS2 subscription. More...

Inheritance diagram for rosros.rospify.topics.Subscriber:
Inheritance graph

Public Member Functions

 __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`.
 

Detailed Description

Stand-in for `rospy.Subscriber`, wrapping the creation of ROS2 subscription.

Definition at line 71 of file topics.py.

Member Function Documentation

◆ __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
namegraph resource name of topic, e.g. 'laser'
data_classdata type class to use for messages, e.g. std_msgs.msg.String
callbackfunction 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_argsadditional arguments to pass to the callback. This is useful when you wish to reuse the same callback for multiple subscriptions.
queue_sizemaximum number of messages to receive at a time. This will generally be 1 or None (infinite, default).
buff_sizeignored (ROS1 compatibility stand-in)
tcp_nodelayignored (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: