Public Member Functions | Public Attributes | Private Member Functions | List of all members
diagnostic_updater._diagnostic_updater.Updater Class Reference
Inheritance diagram for diagnostic_updater._diagnostic_updater.Updater:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def addedTaskCallback (self, task)
 
def broadcast (self, lvl, msg)
 
def force_update (self)
 
def publish (self, msg)
 
def setHardwareID (self, hwid)
 
def update (self)
 
- Public Member Functions inherited from diagnostic_updater._diagnostic_updater.DiagnosticTaskVector
def add (self, *args)
 
def removeByName (self, name)
 

Public Attributes

 hwid
 
 last_time
 
 last_time_period_checked
 
 period
 
 publisher
 
 verbose
 
 warn_nohwid_done
 
- Public Attributes inherited from diagnostic_updater._diagnostic_updater.DiagnosticTaskVector
 lock
 
 tasks
 

Private Member Functions

def _check_diagnostic_period (self)
 

Detailed Description

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.

Definition at line 242 of file _diagnostic_updater.py.

Constructor & Destructor Documentation

◆ __init__()

def diagnostic_updater._diagnostic_updater.Updater.__init__ (   self)
Constructs an updater class.

Reimplemented from diagnostic_updater._diagnostic_updater.DiagnosticTaskVector.

Definition at line 257 of file _diagnostic_updater.py.

Member Function Documentation

◆ _check_diagnostic_period()

def diagnostic_updater._diagnostic_updater.Updater._check_diagnostic_period (   self)
private
Recheck the `~diagnostic_period` on the parameter server.

Definition at line 340 of file _diagnostic_updater.py.

◆ addedTaskCallback()

def diagnostic_updater._diagnostic_updater.Updater.addedTaskCallback (   self,
  task 
)
Allows an action to be taken when a task is added. The :class:`Updater` class
uses this to immediately publish a diagnostic that says that the node
is loading.

:param DiagnosticTask task: the added task.

Reimplemented from diagnostic_updater._diagnostic_updater.DiagnosticTaskVector.

Definition at line 374 of file _diagnostic_updater.py.

◆ broadcast()

def diagnostic_updater._diagnostic_updater.Updater.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 int lvl: Level of the diagnostic being output.
:param str msg: Status message to output.

Definition at line 315 of file _diagnostic_updater.py.

◆ force_update()

def diagnostic_updater._diagnostic_updater.Updater.force_update (   self)
Forces the diagnostics to update.

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

Definition at line 278 of file _diagnostic_updater.py.

◆ publish()

def diagnostic_updater._diagnostic_updater.Updater.publish (   self,
  msg 
)
Publishes a single diagnostic status or a vector of diagnostic statuses.

:param msg: The status(es) to publish.
:type msg: diagnostic_msgs.msg.DiagnosticStatus

Definition at line 357 of file _diagnostic_updater.py.

◆ setHardwareID()

def diagnostic_updater._diagnostic_updater.Updater.setHardwareID (   self,
  hwid 
)
:param str hwid: The hardware ID.

Definition at line 334 of file _diagnostic_updater.py.

◆ update()

def diagnostic_updater._diagnostic_updater.Updater.update (   self)
Causes the diagnostics to update if the inter-update interval
has been exceeded.

Definition at line 270 of file _diagnostic_updater.py.

Member Data Documentation

◆ hwid

diagnostic_updater._diagnostic_updater.Updater.hwid

Definition at line 267 of file _diagnostic_updater.py.

◆ last_time

diagnostic_updater._diagnostic_updater.Updater.last_time

Definition at line 262 of file _diagnostic_updater.py.

◆ last_time_period_checked

diagnostic_updater._diagnostic_updater.Updater.last_time_period_checked

Definition at line 263 of file _diagnostic_updater.py.

◆ period

diagnostic_updater._diagnostic_updater.Updater.period

Definition at line 264 of file _diagnostic_updater.py.

◆ publisher

diagnostic_updater._diagnostic_updater.Updater.publisher

Definition at line 260 of file _diagnostic_updater.py.

◆ verbose

diagnostic_updater._diagnostic_updater.Updater.verbose

Definition at line 266 of file _diagnostic_updater.py.

◆ warn_nohwid_done

diagnostic_updater._diagnostic_updater.Updater.warn_nohwid_done

Definition at line 268 of file _diagnostic_updater.py.


The documentation for this class was generated from the following file:


diagnostic_updater
Author(s): Kevin Watts, Brice Rebsamen , Jeremy Leibs, Blaise Gassend
autogenerated on Tue May 6 2025 02:17:37