RclcppPublisherInterface Class Template
Implementation of the publisher interface for a rclcpp publisher. More...
Declaration
class moveit_pro::behaviors::RclcppPublisherInterface<MessageT> { ... }
Included Headers
Base class
| class | PublisherInterfaceBase<MessageT> |
|
Defines an interface to a publisher that sends a message to a topic. More... | |
Public Constructors Index
template <typename MessageT> | |
| RclcppPublisherInterface (const std::shared_ptr< rclcpp::Node > node) | |
Public Member Functions Index
template <typename MessageT> | |
| auto | initialize (const std::string &topic_name, const size_t queue_size, const bool use_best_effort) override -> tl::expected< void, std::string > |
|
Initializes the rclcpp publisher interface to publish on the provided topic. More... | |
template <typename MessageT> | |
| auto | publish (const MessageT &message) override -> tl::expected< void, std::string > |
|
Publish a message to a topic. More... | |
Private Member Attributes Index
template <typename MessageT> | |
| std::shared_ptr< rclcpp::Node > | node_ |
|
Node used to create the publisher. More... | |
template <typename MessageT> | |
| std::shared_ptr< rclcpp::Publisher< MessageT > > | publisher_ |
|
The publisher, which is created when when initialize() is called. More... | |
Description
Implementation of the publisher interface for a rclcpp publisher.
Definition at line 52 of file publisher_interface.hpp.
Public Constructors
RclcppPublisherInterface()
| explicit |
Declaration at line 55 of file publisher_interface.hpp, definition at line 15 of file publisher_interface_impl.hpp.
Public Member Functions
initialize()
| virtual |
Initializes the rclcpp publisher interface to publish on the provided topic.
If a publisher was previously created for this Behavior (for example, if the Behavior is under a RepeatUntilFailure decorator node), the new topic name is compared to the existing publisher's topic name. The existing publisher's queue_size and reliability QoS settings are also compared to the new queue_size and reliability QoS settings. The publisher is reinitialized if the topic name has changed since it was created, or if the queue_size/reliability QoS settings have changed. Otherwise, the same publisher is reused.
Declaration at line 65 of file publisher_interface.hpp, definition at line 20 of file publisher_interface_impl.hpp.
publish()
| virtual |
Publish a message to a topic.
Declaration at line 69 of file publisher_interface.hpp, definition at line 49 of file publisher_interface_impl.hpp.
Private Member Attributes
node_
|
Node used to create the publisher.
Definition at line 73 of file publisher_interface.hpp.
publisher_
|
The publisher, which is created when when initialize() is called.
Definition at line 76 of file publisher_interface.hpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.