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