|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Go to the documentation of this file.
5 #ifndef PUBLISHER_HANDLER_H
6 #define PUBLISHER_HANDLER_H
9 #include <ros/package.h>
23 template <
class TopicType>
45 PublisherHandler_impl(ros::NodeHandle& nh,
const std::string& address,
const unsigned int& buffer_size = 1,
const bool& latch =
false,
46 const double& rate = 0.0);
54 void publish(
const TopicType& msg);
61 void publish(
const boost::shared_ptr<TopicType>& msg);
68 void publish(
const boost::shared_ptr<TopicType const>& msg);
78 ros::Publisher publisher_;
79 std::mutex mutex_publisher_;
80 std::atomic<bool> publisher_initialized_;
82 bool throttle_ =
false;
83 double throttle_min_dt_;
84 ros::Time last_time_published_;
94 template <
class TopicType>
132 PublisherHandler(ros::NodeHandle& nh,
const std::string& address,
const unsigned int& buffer_size = 1,
const bool& latch =
false,
const double& rate = 0);
139 void publish(
const TopicType& msg);
146 void publish(
const boost::shared_ptr<TopicType>& msg);
153 void publish(
const boost::shared_ptr<TopicType const>& msg);
163 std::shared_ptr<PublisherHandler_impl<TopicType>> impl_;
170 #include <mrs_lib/impl/publisher_handler.hpp>
172 #endif // PUBLISHER_HANDLER_H
PublisherHandler(void)
generic constructor
Definition: publisher_handler.h:101
void publish(const TopicType &msg)
publish message
Definition: publisher_handler.hpp:209
void publish(const TopicType &msg)
publish message
Definition: publisher_handler.hpp:54
~PublisherHandler(void)
generic destructor
Definition: publisher_handler.h:106
PublisherHandler & operator=(const PublisherHandler &other)
operator=
Definition: publisher_handler.hpp:168
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition: attitude_converter.h:29
implementation of the publisher handler
Definition: publisher_handler.h:24
unsigned int getNumSubscribers(void)
get number of subscribers
Definition: publisher_handler.hpp:150
~PublisherHandler_impl(void)
default destructor
Definition: publisher_handler.h:35
user wrapper of the publisher handler implementation
Definition: publisher_handler.h:95
unsigned int getNumSubscribers(void)
get number of subscribers
Definition: publisher_handler.hpp:239
PublisherHandler_impl(void)
default constructor
Definition: publisher_handler.hpp:14