Template Class topic_sink

Inheritance Relationships

Base Types

  • public rmetrics::network_sink

  • public rer::client< topic_sink< TMsg > >

Class Documentation

template<typename TMsg>
class topic_sink : public rmetrics::network_sink, public rer::client<topic_sink<TMsg>>

Metrics sink so that collectors can output their metrics to a ROS topic. Metrics are written every timestep so they are available for the central swarm manager node to collect and process.

Public Functions

inline topic_sink(const std::string &topic, const rmetrics::output_mode &mode, const rtypes::timestep &interval)
virtual ~topic_sink(void) = default
inline void finalize(void) final override
inline rmetrics::write_status flush(const rmetrics::base_data *data, const rtypes::timestep&) override
inline void initialize(const rmetrics::base_data*) override

Protected Functions

inline void pub(const ::ros::Publisher &pub)
inline const ::ros::Publisher *pub(void) const
inline const std::string &topic(void) const

Protected Static Attributes

static constexpr const size_t kQueueBufferSize = 1000

If messages not consumed quickly enough, buffer up this many messages before throwing some away.