Skip to main content

RclcppPublisherInterface Class Template

Implementation of the publisher interface for a rclcpp publisher. More...

Declaration

template <typename MessageT>
class moveit_pro::behaviors::RclcppPublisherInterface<MessageT> { ... }

Included Headers

#include <publisher_interface.hpp>

Base class

classPublisherInterfaceBase<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()

template <typename MessageT>
moveit_pro::behaviors::RclcppPublisherInterface< MessageT >::RclcppPublisherInterface (const std::shared_ptr< rclcpp::Node > node)
explicit

Declaration at line 55 of file publisher_interface.hpp, definition at line 15 of file publisher_interface_impl.hpp.

Public Member Functions

initialize()

template <typename MessageT>
tl::expected< void, std::string > moveit_pro::behaviors::RclcppPublisherInterface< MessageT >::initialize (const std::string & topic_name, const size_t queue_size, const bool use_best_effort)
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()

template <typename MessageT>
tl::expected< void, std::string > moveit_pro::behaviors::RclcppPublisherInterface< MessageT >::publish (const MessageT & message)
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_

template <typename MessageT>
std::shared_ptr<rclcpp::Node> moveit_pro::behaviors::RclcppPublisherInterface< MessageT >::node_

Node used to create the publisher.

Definition at line 73 of file publisher_interface.hpp.

publisher_

template <typename MessageT>
std::shared_ptr<rclcpp::Publisher<MessageT> > moveit_pro::behaviors::RclcppPublisherInterface< MessageT >::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.