diagnostic_updater::Updater Class Reference

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

#include <diagnostic_updater.h>

Inheritance diagram for diagnostic_updater::Updater:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void broadcast (int lvl, const std::string msg)
 Output a message on all the known DiagnosticStatus.
void force_update ()
 Forces the diagnostics to update.
double getPeriod ()
 Returns the interval between updates.
void setHardwareID (const std::string &hwid)
void setHardwareIDf (const char *format,...)
void update ()
 Causes the diagnostics to update if the inter-update interval has been exceeded.
 Updater ()
 Constructs an updater class.

Public Attributes

bool verbose_

Private Member Functions

virtual void addedTaskCallback (DiagnosticTaskInternal &task)
void publish (std::vector< diagnostic_msgs::DiagnosticStatus > &status_vec)
void publish (diagnostic_msgs::DiagnosticStatus &stat)
void setup ()
void update_diagnostic_period ()

Private Attributes

std::string hwid_
ros::Time next_time_
ros::NodeHandle node_handle_
double period_
ros::NodeHandle private_node_handle_
ros::Publisher publisher_
bool warn_nohwid_done_

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 358 of file diagnostic_updater.h.


Constructor & Destructor Documentation

diagnostic_updater::Updater::Updater (  )  [inline]

Constructs an updater class.

Parameters:
h Node handle from which to get the diagnostic_period parameter.

Definition at line 369 of file diagnostic_updater.h.


Member Function Documentation

virtual void diagnostic_updater::Updater::addedTaskCallback ( DiagnosticTaskInternal task  )  [inline, private, virtual]

Causes a placeholder DiagnosticStatus to be published as soon as a diagnostic task is added to the Updater.

Reimplemented from diagnostic_updater::DiagnosticTaskVector.

Definition at line 566 of file diagnostic_updater.h.

void diagnostic_updater::Updater::broadcast ( int  lvl,
const std::string  msg 
) [inline]

Output a message on all the known DiagnosticStatus.

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

Parameters:
lvl Level of the diagnostic being output.
msg Status message to output.

Definition at line 472 of file diagnostic_updater.h.

void diagnostic_updater::Updater::force_update (  )  [inline]

Forces the diagnostics to update.

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

Definition at line 395 of file diagnostic_updater.h.

double diagnostic_updater::Updater::getPeriod (  )  [inline]

Returns the interval between updates.

Definition at line 444 of file diagnostic_updater.h.

void diagnostic_updater::Updater::publish ( std::vector< diagnostic_msgs::DiagnosticStatus > &  status_vec  )  [inline, private]

Publishes a vector of diagnostic statuses.

Definition at line 532 of file diagnostic_updater.h.

void diagnostic_updater::Updater::publish ( diagnostic_msgs::DiagnosticStatus &  stat  )  [inline, private]

Publishes a single diagnostic status.

Definition at line 522 of file diagnostic_updater.h.

void diagnostic_updater::Updater::setHardwareID ( const std::string &  hwid  )  [inline]

Definition at line 502 of file diagnostic_updater.h.

void diagnostic_updater::Updater::setHardwareIDf ( const char *  format,
  ... 
) [inline]

Definition at line 491 of file diagnostic_updater.h.

void diagnostic_updater::Updater::setup (  )  [inline, private]

Publishes on /diagnostics and reads the diagnostic_period parameter.

Definition at line 549 of file diagnostic_updater.h.

void diagnostic_updater::Updater::update (  )  [inline]

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

Definition at line 378 of file diagnostic_updater.h.

void diagnostic_updater::Updater::update_diagnostic_period (  )  [inline, private]

Recheck the diagnostic_period on the parameter server. (Cached)

Definition at line 512 of file diagnostic_updater.h.


Member Data Documentation

std::string diagnostic_updater::Updater::hwid_ [private]

Definition at line 581 of file diagnostic_updater.h.

Definition at line 578 of file diagnostic_updater.h.

ros::NodeHandle diagnostic_updater::Updater::node_handle_ [private]

Definition at line 575 of file diagnostic_updater.h.

Definition at line 580 of file diagnostic_updater.h.

Definition at line 574 of file diagnostic_updater.h.

ros::Publisher diagnostic_updater::Updater::publisher_ [private]

Definition at line 576 of file diagnostic_updater.h.

Definition at line 361 of file diagnostic_updater.h.

Definition at line 582 of file diagnostic_updater.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs


diagnostic_updater
Author(s): Jeremy Leibs, Blaise Gassend
autogenerated on Fri Jan 11 09:12:25 2013