RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rtctk::rtcSupervisor::StatusEstimator Class Reference

Class for system status estimation. More...

#include <statusEstimator.hpp>

Public Member Functions

 StatusEstimator ()
 
virtual ~StatusEstimator ()=default
 
void Reset ()
 Reset internal state of the StatusEstimator object.
 
std::string EstimateStatus (const std::string &name, const std::string &state)
 Public method to estimate system status.
 

Protected Member Functions

virtual std::string ApplyEstimationHeuristic (const std::map< std::string, std::string > &states)
 The actual system status estimation algorithm.
 

Protected Attributes

std::map< std::string, std::string > m_states
 
std::map< std::string, std::string > m_prev_states
 
std::string m_prev_status
 

Detailed Description

Class for system status estimation.

Constructor & Destructor Documentation

◆ StatusEstimator()

rtctk::rtcSupervisor::StatusEstimator::StatusEstimator ( )

◆ ~StatusEstimator()

virtual rtctk::rtcSupervisor::StatusEstimator::~StatusEstimator ( )
virtualdefault

Member Function Documentation

◆ ApplyEstimationHeuristic()

std::string rtctk::rtcSupervisor::StatusEstimator::ApplyEstimationHeuristic ( const std::map< std::string, std::string > & states)
protectedvirtual

The actual system status estimation algorithm.

Override this method in case you need a custom status estimation algorithm. For more complicated algorithms you can also take the map keys (component names) and the protected member variables of this class m_prev_status and m_rev_states into account;

Returns
One of the status string constants defined above, e.g.: STATUS_NOT_READY

Note, we are returning a string here on purpuse to keep the method open for future extension where individual consortia may want to return a richer set of status strings.

◆ EstimateStatus()

std::string rtctk::rtcSupervisor::StatusEstimator::EstimateStatus ( const std::string & name,
const std::string & state )

Public method to estimate system status.

This method is NOT thrad safe, it is supposed to be called sequentially from a single callback thread in StateSubscriber.

Parameters
namecomponent name
statecomponent state
Returns
One of the status string constants defined above, e.g.: STATUS_NOT_READY

Note, we are returning a string here on purpuse to keep the method open for future extension where individual consortia may want to return a richer set of status strings.

◆ Reset()

void rtctk::rtcSupervisor::StatusEstimator::Reset ( )

Reset internal state of the StatusEstimator object.

Member Data Documentation

◆ m_prev_states

std::map<std::string, std::string> rtctk::rtcSupervisor::StatusEstimator::m_prev_states
protected

◆ m_prev_status

std::string rtctk::rtcSupervisor::StatusEstimator::m_prev_status
protected

◆ m_states

std::map<std::string, std::string> rtctk::rtcSupervisor::StatusEstimator::m_states
protected

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