Public Member Functions | Protected Attributes | List of all members
cras::TopicStatus< Message, typename > Class Template Reference

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

#include <topic_status.hpp>

Inheritance diagram for cras::TopicStatus< Message, typename >:
Inheritance graph
[legend]

Public Member Functions

::ros::Rate getExpectedRate () const
 Get the expected/average rate. If min and max are the same, their value will be returned. If min rate is non-positive, the max rate is returned. Otherwise, if max rate is infinite, the min rate will be returned. If min is positive and max is finite, their arithmetic mean is returned. More...
 
template<typename M = Message, typename = ::std::enable_if_t<::ros::message_traits::HasHeader<M>::value>>
::ros::Duration getMaxDelay () const
 Max acceptable delay (in s). It can be negative if timestamps in future are expected. More...
 
::ros::Rate getMaxRate () const
 Maximum allowed frequency. More...
 
template<typename M = Message, typename = ::std::enable_if_t<::ros::message_traits::HasHeader<M>::value>>
::ros::Duration getMinDelay () const
 Min acceptable delay (in s). It can be negative if timestamps in future are expected. More...
 
::ros::Rate getMinRate () const
 Minimum allowed frequency. More...
 
double getRateTolerance () const
 Tolerance of frequency. More...
 
int getRateWindowSize () const
 Number of updates during which the frequency is computed. More...
 
virtual void tick (const ::ros::MessageEvent< Message > &event)
 Record that a message has arrived. More...
 
virtual void tick (const ::ros::Time &stamp)
 Record that a message has arrived now with the given timestamp. More...
 
virtual void tick (const Message &message)
 Record that a message has arrived. More...
 
virtual void tick (const typename Message::ConstPtr &message)
 Record that a message has arrived. More...
 
virtual void tick (const typename Message::Ptr &message)
 Record that a message has arrived. More...
 
 TopicStatus (const ::std::string &name, const ::cras::SimpleTopicStatusParam< Message > &params)
 Create the diagnostic task checking frequency of messages and timestamp delay (if the message has header). More...
 
template<typename M = Message, ::std::enable_if_t<!::ros::message_traits::HasHeader< M >::value, bool > = true>
 TopicStatus (const ::std::string &name, const ::cras::TopicStatusParam< Message > &params)
 Create the diagnostic task for a header-less message (checking frequency only). More...
 
template<typename M = Message, ::std::enable_if_t<::ros::message_traits::HasHeader< M >::value, bool > = true>
 TopicStatus (const ::std::string &name, const ::cras::TopicStatusParam< Message > &params)
 Create the diagnostic task for a message with header (checking frequency and timestamp delay). More...
 
template<typename M = Message, ::std::enable_if_t<!::ros::message_traits::HasHeader< M >::value, bool > = true>
 TopicStatus (const ::std::string &name, const double minRate=0.0, const double maxRate=::std::numeric_limits< double >::infinity(), const double rateTolerance=0.1, const int rateWindowSize=5)
 Create the diagnostic task for a header-less message (checking frequency only). More...
 
template<typename M = Message, ::std::enable_if_t<::ros::message_traits::HasHeader< M >::value, bool > = true>
 TopicStatus (const ::std::string &name, const double minRate=0.0, const double maxRate=::std::numeric_limits< double >::infinity(), const double rateTolerance=0.1, const int rateWindowSize=5, const double minDelay=-1.0, const double maxDelay=5.0)
 Create the diagnostic task for a message with header (checking frequency and timestamp delay). More...
 
 ~TopicStatus () override
 
- Public Member Functions inherited from diagnostic_updater::CompositeDiagnosticTask
void addTask (DiagnosticTask *t)
 
 CompositeDiagnosticTask (const std::string name)
 
virtual void run (DiagnosticStatusWrapper &stat)
 
- Public Member Functions inherited from diagnostic_updater::DiagnosticTask
 DiagnosticTask (const std::string name)
 
const std::string & getName ()
 
virtual ~DiagnosticTask ()
 

Protected Attributes

::std::unique_ptr<::diagnostic_updater::FrequencyStatusfreqTask
 The frequency-checking diagnostic task. This will always be non-null. More...
 
::cras::TopicStatusParam< Message > origParams
 The parameters via which this task has been configured. More...
 
::std::unique_ptr<::diagnostic_updater::SlowTimeStampStatusstampTask
 The delay-checking diagnostic task. It will be non-null only for messages with header. More...
 

Detailed Description

template<typename Message, typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
class cras::TopicStatus< Message, typename >

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 topic_status.hpp.

Constructor & Destructor Documentation

◆ TopicStatus() [1/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, ::std::enable_if_t<!::ros::message_traits::HasHeader< M >::value, bool > = true>
cras::TopicStatus< Message, typename >::TopicStatus ( const ::std::string &  name,
const ::cras::TopicStatusParam< Message > &  params 
)
inline

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.

Definition at line 44 of file topic_status.hpp.

◆ TopicStatus() [2/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, ::std::enable_if_t<!::ros::message_traits::HasHeader< M >::value, bool > = true>
cras::TopicStatus< Message, typename >::TopicStatus ( const ::std::string &  name,
const double  minRate = 0.0,
const double  maxRate = ::std::numeric_limits<double>::infinity(),
const double  rateTolerance = 0.1,
const int  rateWindowSize = 5 
)
inlineexplicit

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]minRateMinimum allowed frequency.
[in]maxRateMaximum allowed frequency.
[in]rateToleranceTolerance of the rate.
[in]rateWindowSizeNumber of updates during which the frequency is computed.

Definition at line 61 of file topic_status.hpp.

◆ TopicStatus() [3/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, ::std::enable_if_t<::ros::message_traits::HasHeader< M >::value, bool > = true>
cras::TopicStatus< Message, typename >::TopicStatus ( const ::std::string &  name,
const ::cras::TopicStatusParam< Message > &  params 
)
inline

Create the diagnostic task for a message with header (checking frequency and timestamp delay).

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

Definition at line 75 of file topic_status.hpp.

◆ TopicStatus() [4/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, ::std::enable_if_t<::ros::message_traits::HasHeader< M >::value, bool > = true>
cras::TopicStatus< Message, typename >::TopicStatus ( const ::std::string &  name,
const double  minRate = 0.0,
const double  maxRate = ::std::numeric_limits<double>::infinity(),
const double  rateTolerance = 0.1,
const int  rateWindowSize = 5,
const double  minDelay = -1.0,
const double  maxDelay = 5.0 
)
inlineexplicit

Create the diagnostic task for a message with header (checking frequency and timestamp delay).

Template Parameters
MSFINAE only. Do not set explicitly.
Parameters
[in]nameName of the diagnostic task.
[in]minRateMinimum allowed frequency.
[in]maxRateMaximum allowed frequency.
[in]rateToleranceTolerance of the rate.
[in]rateWindowSizeNumber of updates during which the frequency is computed.
[in]minDelayMin acceptable delay (in s). It can be negative if timestamps in future are expected.
[in]maxDelayMax acceptable delay (in s). It can be negative if timestamps in future are expected.

Definition at line 97 of file topic_status.hpp.

◆ TopicStatus() [5/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
cras::TopicStatus< Message, typename >::TopicStatus ( const ::std::string &  name,
const ::cras::SimpleTopicStatusParam< Message > &  params 
)
inline

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.

Definition at line 111 of file topic_status.hpp.

◆ ~TopicStatus()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
cras::TopicStatus< Message, typename >::~TopicStatus ( )
inlineoverride

Definition at line 116 of file topic_status.hpp.

Member Function Documentation

◆ getExpectedRate()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::ros::Rate cras::TopicStatus< Message, typename >::getExpectedRate ( ) const
inline

Get the expected/average rate. If min and max are the same, their value will be returned. If min rate is non-positive, the max rate is returned. Otherwise, if max rate is infinite, the min rate will be returned. If min is positive and max is finite, their arithmetic mean is returned.

Returns
The expected rate (in Hz).

Definition at line 175 of file topic_status.hpp.

◆ getMaxDelay()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, typename = ::std::enable_if_t<::ros::message_traits::HasHeader<M>::value>>
::ros::Duration cras::TopicStatus< Message, typename >::getMaxDelay ( ) const
inline

Max acceptable delay (in s). It can be negative if timestamps in future are expected.

Template Parameters
MSFINAE only. Do not set explicitly.
Returns
The maximum delay.

Definition at line 233 of file topic_status.hpp.

◆ getMaxRate()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::ros::Rate cras::TopicStatus< Message, typename >::getMaxRate ( ) const
inline

Maximum allowed frequency.

Returns
The frequency (in Hz).

Definition at line 193 of file topic_status.hpp.

◆ getMinDelay()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
template<typename M = Message, typename = ::std::enable_if_t<::ros::message_traits::HasHeader<M>::value>>
::ros::Duration cras::TopicStatus< Message, typename >::getMinDelay ( ) const
inline

Min acceptable delay (in s). It can be negative if timestamps in future are expected.

Template Parameters
MSFINAE only. Do not set explicitly.
Returns
The minimum delay.

Definition at line 222 of file topic_status.hpp.

◆ getMinRate()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::ros::Rate cras::TopicStatus< Message, typename >::getMinRate ( ) const
inline

Minimum allowed frequency.

Returns
The frequency (in Hz).

Definition at line 184 of file topic_status.hpp.

◆ getRateTolerance()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
double cras::TopicStatus< Message, typename >::getRateTolerance ( ) const
inline

Tolerance of frequency.

Returns
The tolerance (0.0 means exact match of the frequency bounds).

Definition at line 202 of file topic_status.hpp.

◆ getRateWindowSize()

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
int cras::TopicStatus< Message, typename >::getRateWindowSize ( ) const
inline

Number of updates during which the frequency is computed.

Returns
The window size.

Definition at line 211 of file topic_status.hpp.

◆ tick() [1/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
virtual void cras::TopicStatus< Message, typename >::tick ( const ::ros::MessageEvent< Message > &  event)
inlinevirtual

Record that a message has arrived.

Parameters
[in]eventThe message event describing the message that arrived.

Definition at line 164 of file topic_status.hpp.

◆ tick() [2/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
virtual void cras::TopicStatus< Message, typename >::tick ( const ::ros::Time stamp)
inlinevirtual

Record that a message has arrived now with the given timestamp.

Parameters
[in]stampTimestamp in the message header.

Definition at line 124 of file topic_status.hpp.

◆ tick() [3/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
virtual void cras::TopicStatus< Message, typename >::tick ( const Message &  message)
inlinevirtual

Record that a message has arrived.

Parameters
[in]messageThe message that arrived.

Definition at line 135 of file topic_status.hpp.

◆ tick() [4/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
virtual void cras::TopicStatus< Message, typename >::tick ( const typename Message::ConstPtr &  message)
inlinevirtual

Record that a message has arrived.

Parameters
[in]messageThe message that arrived.

Definition at line 155 of file topic_status.hpp.

◆ tick() [5/5]

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
virtual void cras::TopicStatus< Message, typename >::tick ( const typename Message::Ptr &  message)
inlinevirtual

Record that a message has arrived.

Parameters
[in]messageThe message that arrived.

Definition at line 146 of file topic_status.hpp.

Member Data Documentation

◆ freqTask

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::std::unique_ptr<::diagnostic_updater::FrequencyStatus> cras::TopicStatus< Message, typename >::freqTask
protected

The frequency-checking diagnostic task. This will always be non-null.

Definition at line 240 of file topic_status.hpp.

◆ origParams

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::cras::TopicStatusParam<Message> cras::TopicStatus< Message, typename >::origParams
protected

The parameters via which this task has been configured.

Definition at line 246 of file topic_status.hpp.

◆ stampTask

template<typename Message , typename = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
::std::unique_ptr<::diagnostic_updater::SlowTimeStampStatus> cras::TopicStatus< Message, typename >::stampTask
protected

The delay-checking diagnostic task. It will be non-null only for messages with header.

Definition at line 243 of file topic_status.hpp.


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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04