Package 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)
:param plot: if ``True``, echo in plotting-friendly format, ``bool`` :param filter_fn: function that evaluates to ``True`` if message is to be echo'd, ``fn(topic, msg)`` :param echo_all_topics: (optional) if ``True``, echo all messages in bag, ``bool`` :param offset_time: (optional) if ``True``, display time as offset from current time, ``bool`` :param count: number of messages to echo, ``None`` for infinite, ``int`` :param field_filter_fn: filter the fields that are strified for Messages, ``fn(Message)->iter(str)``
source code
 
custom_strify_message(self, val, indent='', time_offset=None, current_time=None, field_filter=None, type_information=None) source code
 
callback(self, data, callback_args, 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 

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

Overrides: object.__init__

callback(self, data, callback_args, 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 :param data: Message :param topic: topic name, ``str`` :param current_time: override calculation of current time, :class:`genpy.Time`