Module rostopic :: Class CallbackEcho

Class CallbackEcho

source code

object --+
         |
        CallbackEcho

Callback instance that can print callback data in a variety of formats. Used for all variants of rostopic echo

Instance Methods
 
__init__(self, topic, msg_eval, plot=False, filter_fn=None, echo_clear=False, echo_all_topics=False, offset_time=False, count=None, field_filter_fn=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
callback(self, data, topic, current_time=None)
Callback to pass to rospy.Subscriber or to call manually.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, topic, msg_eval, plot=False, filter_fn=None, echo_clear=False, echo_all_topics=False, offset_time=False, count=None, field_filter_fn=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • plot (bool) - if True, echo in plotting-friendly format
  • filter_fn (fn(topic, msg)) - function that evaluates to True if message is to be echo'd
  • echo_all_topics (bool) - (optional) if True, echo all messages in bag
  • offset_time (bool) - (optional) if True, display time as offset from current time
  • count (int) - number of messages to echo, None for infinite
  • field_filter_fn (fn(Message)->iter(str)) - filter the fields that are strified for Messages.
Overrides: object.__init__

callback(self, data, topic, current_time=None)

source code 

Callback to pass to rospy.Subscriber or to call manually. rospy.Subscriber constructor must also pass in the topic name as an additional arg

Parameters:
  • data (Message) - Message
  • topic (str) - topic name
  • current_time (roslib.rostime.Time) - override calculation of current time