Public Member Functions | Protected Attributes | List of all members
cras::DurationStatus Class Reference

Diagnostic task for topic frequency and timestamp delay (combining FrequencyStatus and TimeStampStatus tasks). More...

#include <duration_status.h>

Inheritance diagram for cras::DurationStatus:
Inheritance graph
[legend]

Public Member Functions

 DurationStatus (const ::std::string &name, const ::cras::DurationStatusParam &params)
 Create the diagnostic task for a header-less message (checking frequency only). More...
 
 DurationStatus (const ::std::string &name, const ::ros::Duration &minDuration={0, 0}, const ::ros::Duration &maxDuration=::ros::DURATION_MAX, double tolerance=0.1, size_t windowSize=5u, bool noEventsIsOk=true)
 Create the diagnostic task for a header-less message (checking frequency only). More...
 
 DurationStatus (const ::std::string &name, const ::cras::SimpleDurationStatusParam &params)
 Create the diagnostic task checking frequency of messages and timestamp delay (if the message has header). More...
 
 DurationStatus (const ::std::string &name, const ::cras::BoundParamHelperPtr &params, const ::cras::DurationStatusParam &defaultParams)
 
 DurationStatus (const ::std::string &name, const ::cras::BoundParamHelperPtr &params, const ::cras::SimpleDurationStatusParam &defaultParams)
 
const ::ros::DurationgetMaxDuration () const
 Maximum allowed duration. More...
 
const ::ros::DurationgetMinDuration () const
 Minimum allowed duration. More...
 
double getTolerance () const
 Tolerance of duration. More...
 
size_t getWindowSize () const
 Number of updates during which the duration is computed. More...
 
void run (::diagnostic_updater::DiagnosticStatusWrapper &stat) override
 
void start (const ::ros::Time &time=::ros::Time::now())
 Start a single duration measurement. More...
 
void start (const ::ros::WallTime &time)
 Start a single duration measurement. More...
 
void stop (const ::ros::Time &time=::ros::Time::now())
 Stop a single duration measurement. More...
 
void stop (const ::ros::WallTime &time)
 Stop a single duration measurement. More...
 
 ~DurationStatus () override
 
- Public Member Functions inherited from diagnostic_updater::DiagnosticTask
 DiagnosticTask (const std::string name)
 
const std::string & getName ()
 
virtual void run (diagnostic_updater::DiagnosticStatusWrapper &stat)=0
 
virtual ~DiagnosticTask ()
 

Protected Attributes

size_t count {0u}
 
size_t historyIndex {0u}
 
::std::vector<::cras::RunningStats<::ros::Duration > > historyStats
 
::std::vector<::ros::TimehistoryTimes
 
::cras::optional<::ros::TimelastStartTime
 
::std::mutex lock
 
::std::vector<::ros::DurationmaxDurations
 
::std::vector<::ros::DurationminDurations
 
::cras::DurationStatusParam params
 The parameters via which this task has been configured. More...
 
::cras::RunningStats<::ros::Durationstats
 
bool wallTimeMode {false}
 

Detailed Description

Diagnostic task for topic frequency and timestamp delay (combining FrequencyStatus and TimeStampStatus tasks).

Template Parameters
MessageType of the message. If it contains a header field, the task will automatically check both frequency and timestamp delay. Header-less messages will only have their frequency checked.

Definition at line 34 of file duration_status.h.

Constructor & Destructor Documentation

◆ DurationStatus() [1/5]

cras::DurationStatus::DurationStatus ( const ::std::string &  name,
const ::cras::DurationStatusParam params 
)

Create the diagnostic task for a header-less message (checking frequency only).

Template Parameters
MSFINAE only. Do not set explicitly.
Parameters
[in]nameName of the diagnostic task.
[in]paramsParameters of the task.

◆ DurationStatus() [2/5]

cras::DurationStatus::DurationStatus ( const ::std::string &  name,
const ::ros::Duration minDuration = {0, 0},
const ::ros::Duration maxDuration = ::ros::DURATION_MAX,
double  tolerance = 0.1,
size_t  windowSize = 5u,
bool  noEventsIsOk = true 
)
explicit

Create the diagnostic task for a header-less message (checking frequency only).

Template Parameters
MSFINAE only. Do not set explicitly.
Parameters
[in]nameName of the diagnostic task.
[in]minDurationMinimum allowed duration.
[in]maxDurationMaximum allowed duration.
[in]toleranceTolerance of duration.
[in]windowSizeNumber of updates during which the duration is computed.
[in]noEventsIsOkWhether it should be treated as correct if there was no event during an update window.

◆ DurationStatus() [3/5]

cras::DurationStatus::DurationStatus ( const ::std::string &  name,
const ::cras::SimpleDurationStatusParam params 
)

Create the diagnostic task checking frequency of messages and timestamp delay (if the message has header).

Parameters
[in]nameName of the diagnostic task.
[in]paramsParameters of the task.

◆ DurationStatus() [4/5]

cras::DurationStatus::DurationStatus ( const ::std::string &  name,
const ::cras::BoundParamHelperPtr params,
const ::cras::DurationStatusParam defaultParams 
)

◆ DurationStatus() [5/5]

cras::DurationStatus::DurationStatus ( const ::std::string &  name,
const ::cras::BoundParamHelperPtr params,
const ::cras::SimpleDurationStatusParam defaultParams 
)

◆ ~DurationStatus()

cras::DurationStatus::~DurationStatus ( )
override

Member Function Documentation

◆ getMaxDuration()

const ::ros::Duration& cras::DurationStatus::getMaxDuration ( ) const

Maximum allowed duration.

Returns
The duration.

◆ getMinDuration()

const ::ros::Duration& cras::DurationStatus::getMinDuration ( ) const

Minimum allowed duration.

Returns
The duration.

◆ getTolerance()

double cras::DurationStatus::getTolerance ( ) const

Tolerance of duration.

Returns
The tolerance (0.0 means exact match of the duration limits).

◆ getWindowSize()

size_t cras::DurationStatus::getWindowSize ( ) const

Number of updates during which the duration is computed.

Returns
The window size.

◆ run()

void cras::DurationStatus::run ( ::diagnostic_updater::DiagnosticStatusWrapper stat)
override

◆ start() [1/2]

void cras::DurationStatus::start ( const ::ros::Time time = ::ros::Time::now())

Start a single duration measurement.

Parameters
[in]timeTime of start.

◆ start() [2/2]

void cras::DurationStatus::start ( const ::ros::WallTime time)

Start a single duration measurement.

Parameters
[in]timeTime of start.

◆ stop() [1/2]

void cras::DurationStatus::stop ( const ::ros::Time time = ::ros::Time::now())

Stop a single duration measurement.

Parameters
[in]timeTime of end.

◆ stop() [2/2]

void cras::DurationStatus::stop ( const ::ros::WallTime time)

Stop a single duration measurement.

Parameters
[in]timeTime of end.

Member Data Documentation

◆ count

size_t cras::DurationStatus::count {0u}
protected

Definition at line 129 of file duration_status.h.

◆ historyIndex

size_t cras::DurationStatus::historyIndex {0u}
protected

Definition at line 136 of file duration_status.h.

◆ historyStats

::std::vector<::cras::RunningStats<::ros::Duration> > cras::DurationStatus::historyStats
protected

Definition at line 135 of file duration_status.h.

◆ historyTimes

::std::vector<::ros::Time> cras::DurationStatus::historyTimes
protected

Definition at line 134 of file duration_status.h.

◆ lastStartTime

::cras::optional<::ros::Time> cras::DurationStatus::lastStartTime
protected

Definition at line 131 of file duration_status.h.

◆ lock

::std::mutex cras::DurationStatus::lock
protected

Definition at line 137 of file duration_status.h.

◆ maxDurations

::std::vector<::ros::Duration> cras::DurationStatus::maxDurations
protected

Definition at line 133 of file duration_status.h.

◆ minDurations

::std::vector<::ros::Duration> cras::DurationStatus::minDurations
protected

Definition at line 132 of file duration_status.h.

◆ params

::cras::DurationStatusParam cras::DurationStatus::params
protected

The parameters via which this task has been configured.

Definition at line 126 of file duration_status.h.

◆ stats

::cras::RunningStats<::ros::Duration> cras::DurationStatus::stats
protected

Definition at line 130 of file duration_status.h.

◆ wallTimeMode

bool cras::DurationStatus::wallTimeMode {false}
protected

Definition at line 128 of file duration_status.h.


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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53