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 | added |
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 |
Forces the diagnostics to update. |
Method | publish |
Publishes a single diagnostic status or a vector of diagnostic statuses. |
Method | set |
Undocumented |
Method | update |
Causes the diagnostics to update if the inter-update interval has been exceeded. |
Instance Variable | hwid |
Undocumented |
Instance Variable | last |
Undocumented |
Instance Variable | last |
Undocumented |
Instance Variable | period |
Undocumented |
Instance Variable | publisher |
Undocumented |
Instance Variable | verbose |
Undocumented |
Instance Variable | warn |
Undocumented |
Method | _check |
Recheck the diagnostic_period on the parameter server. |
Inherited from DiagnosticTaskVector
:
Class |
|
Class used to represent a diagnostic task internally in DiagnosticTaskVector. |
Method | add |
Add a task to the DiagnosticTaskVector. |
Method | remove |
Removes a task based on its name. |
Instance Variable | lock |
Undocumented |
Instance Variable | tasks |
Undocumented |
niryo_libraries.diagnostic_updater._diagnostic_updater.DiagnosticTaskVector.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.
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.
Forces the diagnostics to update.
Useful if the node has undergone a drastic state change that should be published immediately.