Skip to content

Class nebula::ros::LivenessMonitor

ClassList > nebula > ros > LivenessMonitor

Monitor whether a routine is alive (is running at least once in a given period). More...

  • #include <liveness_monitor.hpp>

Inherits the following classes: diagnostic_updater::DiagnosticTask

Public Functions

Type Name
LivenessMonitor (const std::string & name, const rclcpp::Node * parent_node, const rclcpp::Duration & timeout)
Create and activate a new liveness monitor.
void tick ()
Proves the liveness of a routine. Has to be called frequently.

Detailed Description

This can be used for getting notified when a certain routine gets stuck, e.g. when packets stop arriving or when pointclouds stop being published.

Public Functions Documentation

function LivenessMonitor

Create and activate a new liveness monitor.

inline nebula::ros::LivenessMonitor::LivenessMonitor (
    const std::string & name,
    const rclcpp::Node * parent_node,
    const rclcpp::Duration & timeout
) 

The monitored routine has to call tick() on every iteration to prove its liveness. If there is no call for a length of timeout, the routine is declared dead.

Parameters:

  • name The name of the task
  • parent_node The node from which clock type and parameters are read.
  • timeout The time after the last call to tick() where the routine is declared dead

function tick

Proves the liveness of a routine. Has to be called frequently.

inline void nebula::ros::LivenessMonitor::tick () 

A call to tick() resets the internal timer. If the timer is not reset at least once before it expires (within timeout), the monitored routine is pronounced dead.



The documentation for this class was generated from the following file nebula_ros/include/nebula_ros/common/diagnostics/liveness_monitor.hpp