Class Publisher

Nested Relationships

Nested Types

Class Documentation

class Publisher

Publisher concept interface.

Note

this defines an private concept struct, which each instance has to implement

Note

a type erasure pattern in implemented here to avoid strict inheritance, thus each possible publisher instance has to implement the virtual functions mentioned in the concept

Public Functions

template<typename T>
inline Publisher(const T &pub)

Constructor for publisher interface.

inline bool isInitialized() const

checks if the publisher is correctly initialized on the ros-master @

Returns:

bool value indicating true for success

inline bool isSubscribed() const

checks if the publisher has a subscription and is hence allowed to publish

Returns:

bool value indicating true for number of sub > 0

inline void reset(rclcpp::Node *node)

initializes/resets the publisher into ROS with a given Node object, this will be called at first for initialization

Parameters:

node – rclcpp::Node pointer from which the publisher is created

inline std::string topic() const

getting the topic to publish on

Returns:

string indicating the topic

Friends

inline friend bool operator==(const Publisher &lhs, const Publisher &rhs)
inline friend bool operator==(const boost::shared_ptr<Publisher> &lhs, const boost::shared_ptr<Publisher> &rhs)