Class IgnoreAnalyzer

Inheritance Relationships

Base Type

Class Documentation

class IgnoreAnalyzer : public diagnostic_aggregator::Analyzer

IgnoreAnalyzer ignores all analyzer parameters and does nothing.

IgnoreAnalyzer is used to get rid of an Analyzer that is no longer part of a robot configuration.

*<launch>
*  <include file="$(find my_pkg)/my_analyzers.launch" />
*
*  <!-- Overwrite a specific Analyzer to discard all -->
*  <param name="diag_agg/analyzers/motors/type" value="IgnoreAnalyzer" />
*</launch>
*

Public Functions

DIAGNOSTIC_AGGREGATOR_PUBLIC IgnoreAnalyzer()

Default constructor loaded by pluginlib.

virtual DIAGNOSTIC_AGGREGATOR_PUBLIC ~IgnoreAnalyzer()
virtual DIAGNOSTIC_AGGREGATOR_PUBLIC bool init (const std::string &base_path, const std::string &breadcrumb, const rclcpp::Node::SharedPtr node)

Analyzer is initialized with base path and namespace.

The Analyzer initialized with parameters in its given namespace. The “base_path” is common to all analyzers, and needs to be prepended to all DiagnosticStatus names.

Parameters:
  • base_path – : Common to all analyzers, prepended to all processed names. Starts with “/”.

  • breadcrumb – : Prefix for parameter getter.

  • n – : NodeHandle with proper private namespace for analyzer.

inline virtual bool match(const std::string &name)

Returns true if analyzer will handle this item.

Match is called once for each new status name, so this return value cannot change with time.

inline virtual bool analyze(std::shared_ptr<StatusItem> item)

Returns true if analyzer will analyze this name.

This is called with every new item that an analyzer matches. Analyzers should only return “true” if they will report the value of this item. If it is only looking at an item, it should return false.

virtual DIAGNOSTIC_AGGREGATOR_PUBLIC std::vector< std::shared_ptr< diagnostic_msgs::msg::DiagnosticStatus > > report ()

Analysis function, output processed data.

report is called at 1Hz intervals. Analyzers should return a vector of processed DiagnosticStatus messages.

Returns:

The array of DiagnosticStatus messages must have proper names, with prefixes prepended

inline virtual std::string getPath() const

Returns full prefix of analyzer. (ex: ‘/Robot/Sensors’)

inline virtual std::string getName() const

Returns nice name for display. (ex: ‘Sensors’)