class documentation

class Updater(DiagnosticTaskVector):

Constructor: Updater()

View In Hierarchy

Manages a list of diagnostic tasks, and calls them in a rate-limited manner.

This class manages a list of diagnostic tasks. Its update function should be called frequently. At some predetermined rate, the update function will cause all the diagnostic tasks to run, and will collate and publish the resulting diagnostics. The publication rate is determined by the "~diagnostic_period" ros parameter.

The class also allows an update to be forced when something significant has happened, and allows a single message to be broadcast on all the diagnostics if normal operation of the node is suspended for some reason.

Method __init__ Constructs an updater class.
Method addedTaskCallback Allows an action to be taken when a task is added. The Updater class uses this to immediately publish a diagnostic that says that the node is loading.
Method broadcast Outputs a message on all the known DiagnosticStatus.
Method force_update Forces the diagnostics to update.
Method publish Publishes a single diagnostic status or a vector of diagnostic statuses.
Method setHardwareID Undocumented
Method update Causes the diagnostics to update if the inter-update interval has been exceeded.
Instance Variable hwid Undocumented
Instance Variable last_time Undocumented
Instance Variable last_time_period_checked Undocumented
Instance Variable period Undocumented
Instance Variable publisher Undocumented
Instance Variable verbose Undocumented
Instance Variable warn_nohwid_done Undocumented
Method _check_diagnostic_period Recheck the diagnostic_period on the parameter server.

Inherited from DiagnosticTaskVector:

Class DiagnosticTaskInternal Class used to represent a diagnostic task internally in DiagnosticTaskVector.
Method add Add a task to the DiagnosticTaskVector.
Method removeByName Removes a task based on its name.
Instance Variable lock Undocumented
Instance Variable tasks Undocumented
def addedTaskCallback(self, task):

Allows an action to be taken when a task is added. The Updater class uses this to immediately publish a diagnostic that says that the node is loading.

def broadcast(self, lvl, msg):

Outputs a message on all the known DiagnosticStatus.

Useful if something drastic is happening such as shutdown or a self-test.

@param lvl Level of the diagnostic being output. @param msg Status message to output.

def force_update(self):

Forces the diagnostics to update.

Useful if the node has undergone a drastic state change that should be published immediately.

def publish(self, msg):

Publishes a single diagnostic status or a vector of diagnostic statuses.

def setHardwareID(self, hwid):

Undocumented

def update(self):

Causes the diagnostics to update if the inter-update interval has been exceeded.

hwid =

Undocumented

last_time =

Undocumented

last_time_period_checked =

Undocumented

period =

Undocumented

publisher =

Undocumented

verbose: bool =

Undocumented

warn_nohwid_done: bool =

Undocumented

def _check_diagnostic_period(self):

Recheck the diagnostic_period on the parameter server.