dynamic_timeline_listener.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import rospy
4 from .plugins.message_view import MessageView
5 
6 class DynamicTimelineListener(MessageView):
7  """Basic listener for the timeline. The current message can be accessed using
8  the ``msg`` member.
9 
10  """
11  def __init__(self, timeline, topic, signal_viewed, signal_cleared):
12  """
13  :param timeline: the timeline that this object is attached to
14  :param topic: the topic that this object is interested in
15  :param signal_viewed: the signal that should be emitted when the message being viewed changes
16  :param signal_cleared: the signal that should be emitted when the message being viewed is cleared
17  """
18  super(DynamicTimelineListener, self).__init__(timeline, topic)
19  self.signal_viewed = signal_viewed
20  self.signal_cleared = signal_cleared
21  self.msg = None
22 
23  def message_viewed(self, msg_details):
24  """Called whenever the message is updated. Updates the stored message and emits
25  a signal.
26  """
27  self.msg = msg_details
28  # rospy.loginfo("got message {0} on topic {1}".format(msg_details.behaviours[0].name, self.topic))
29  self.signal_viewed.emit()
30 
31  def message_cleared(self):
32  self.signal_cleared.emit()
def __init__(self, timeline, topic, signal_viewed, signal_cleared)


rqt_py_trees
Author(s): Thibault Kruse, Michal Staniaszek, Daniel Stonier, Naveed Usmani
autogenerated on Mon Jun 10 2019 14:55:56