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
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 TimeStampStatus.
54 """Constructs a HeaderlessTopicDiagnostic.
56 @param name The name of the topic that is being diagnosed.
58 @param diag The diagnostic_updater that the CompositeDiagnosticTask
61 @param freq The parameters for the FrequencyStatus class that will be
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 FrequencyStatus and TimeStampStatus.
85 """Constructs a TopicDiagnostic.
87 @param name The name of the topic that is being diagnosed.
89 @param diag The diagnostic_updater that the CompositeDiagnosticTask
92 @param freq The parameters for the FrequencyStatus class that will be
95 @param stamp The parameters for the TimeStampStatus class that will be
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 TimeStampStatus class.
110 HeaderlessTopicDiagnostic.tick(self)
114 """A TopicDiagnostic combined with a ros::Publisher.
116 For a standard ros::Publisher, this class allows the ros::Publisher and
117 the TopicDiagnostic to be combined for added convenience.
121 """Constructs a DiagnosedPublisher.
123 @param pub The publisher on which statistics are being collected.
125 @param diag The diagnostic_updater that the CompositeDiagnosticTask
126 should add itself to.
128 @param freq The parameters for the FrequencyStatus class that will be
129 computing statistics.
131 @param stamp The parameters for the TimeStampStatus class that will be
132 computing statistics.
134 TopicDiagnostic.__init__(self, pub.name, diag, freq, stamp)
138 """Collects statistics and publishes the message.
140 The timestamp to be used by the TimeStampStatus class will be
141 extracted from message.header.stamp.
143 self.
tick(message.header.stamp)