35 """ diagnostic_updater for Python.
36 @author Brice Rebsamen <brice [dot] rebsamen [gmail]>
41 from ._update_functions
import *
45 """A class to facilitate making diagnostics for a topic using a
46 :class:`FrequencyStatus`.
48 The word "headerless" in the class name refers to the fact that it is
49 mainly designed for use with messages that do not have a header, and
50 that cannot therefore be checked using a :class:`TimeStampStatus`.
54 """Constructs a :class:`HeaderlessTopicDiagnostic`.
56 :param str name: The name of the topic that is being diagnosed.
58 :param diagnostic_updater.Updater diag: The :class:`Updater` that the :class:`CompositeDiagnosticTask`
61 :param diagnostic_updater.FrequencyStatusParam freq: The parameters for the :class:`FrequencyStatus`
62 class that will be computing statistics.
64 CompositeDiagnosticTask.__init__(self, name +
" topic status")
71 """Signals that a publication has occurred."""
75 """Clears the frequency statistics."""
80 """A class to facilitate making diagnostics for a topic using a
81 :class:`FrequencyStatus` and :class:`TimeStampStatus`.
85 """Constructs a :class:`TopicDiagnostic`.
87 :param str name: The name of the topic that is being diagnosed.
89 :param diagnostic_updater.Updater diag: The :class:`Updater` that the :class:`CompositeDiagnosticTask`
92 :param diagnostic_updater.FrequencyStatusParam freq: The parameters for the :class:`FrequencyStatus`
93 class that will be computing statistics.
95 :param diagnostic_updater.TimeStampStatusParam stamp: The parameters for the :class:`TimeStampStatus`
96 class that will be computing statistics.
99 HeaderlessTopicDiagnostic.__init__(self, name, diag, freq)
104 """Collects statistics and publishes the message.
106 :param stamp: Timestamp to use for interval computation by the
107 :class:`TimeStampStatus` class.
108 :type stamp: float or rospy.Time
111 HeaderlessTopicDiagnostic.tick(self)
115 """A :class:`TopicDiagnostic` combined with a :class:`rospy.Publisher`.
117 For a standard :class:`rospy.Publisher`, this class allows the :class:`rospy.Publisher` and
118 the :class:`TopicDiagnostic` to be combined for added convenience.
122 """Constructs a :class:`DiagnosedPublisher`.
124 :param rospy.Publisher pub: The publisher on which statistics are being collected.
126 :param diagnostic_updater.Updater diag: The :class:`Updater` that the :class:`CompositeDiagnosticTask`
127 should add itself to.
129 :param diagnostic_updater.FrequencyStatusParam freq: The parameters for the :class:`FrequencyStatus`
130 class that will be computing statistics.
132 :param diagnostic_updater.TimeStampStatusParam stamp: The parameters for the :class:`TimeStampStatus`
133 class that will be computing statistics.
135 TopicDiagnostic.__init__(self, pub.name, diag, freq, stamp)
139 """Collects statistics and publishes the message.
141 The timestamp to be used by the :class:`TimeStampStatus` class will be
142 extracted from `message.header.stamp`.
144 :param genpy.Message message: The message to be published.
146 self.
tick(message.header.stamp)