Class TopicDiagnostic

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class TopicDiagnostic : public diagnostic_updater::HeaderlessTopicDiagnostic

A class to facilitate making diagnostics for a topic using a FrequencyStatus and TimeStampStatus.

Subclassed by diagnostic_updater::DiagnosedPublisher< MessageT, AllocatorT >

Public Functions

inline TopicDiagnostic(std::string name, diagnostic_updater::Updater &diag, const diagnostic_updater::FrequencyStatusParam &freq, const diagnostic_updater::TimeStampStatusParam &stamp, const rclcpp::Clock::SharedPtr &clock = std::make_shared<rclcpp::Clock>())

Constructs a TopicDiagnostic.

Parameters:
  • name – The name of the topic that is being diagnosed.

  • diag – The diagnostic_updater that the CompositeDiagnosticTask should add itself to.

  • freq – The parameters for the FrequencyStatus class that will be computing statistics.

  • stamp – The parameters for the TimeStampStatus class that will be computing statistics.

  • clock – Pointer to a clock instance. If not provided, the default one will be used

inline virtual ~TopicDiagnostic()
inline virtual void tick()

This method should never be called on a TopicDiagnostic as a timestamp is needed to collect the timestamp diagnostics. It is defined here to prevent the inherited tick method from being used accidentally.

inline virtual void tick(const rclcpp::Time &stamp)

Collects statistics and publishes the message.

Parameters:

stamp – Timestamp to use for interval computation by the TimeStampStatus class.