MoveIt Pro Behavior Interface  5.0.1
Library for developing custom behaviors for use in MoveIt Pro
moveit_studio::behaviors::PublisherInterfaceBase< MessageT > Class Template Referenceabstract

Defines an interface to a publisher that sends a message to a topic. More...

#include <publisher_interface.hpp>

Inheritance diagram for moveit_studio::behaviors::PublisherInterfaceBase< MessageT >:

Public Member Functions

virtual ~PublisherInterfaceBase ()=default
 
virtual tl::expected< void, std::string > initialize (const std::string &topic_name, const size_t queue_size, const bool use_best_effort)=0
 Virtual function to initialize the publisher interface. More...
 
virtual tl::expected< void, std::string > publish (const MessageT &message)=0
 Virtual function to publish a message to a topic. More...
 

Detailed Description

template<typename MessageT>
class moveit_studio::behaviors::PublisherInterfaceBase< MessageT >

Defines an interface to a publisher that sends a message to a topic.

Template Parameters
MessageTMessage type used to specialize this class.

Constructor & Destructor Documentation

◆ ~PublisherInterfaceBase()

template<typename MessageT >
virtual moveit_studio::behaviors::PublisherInterfaceBase< MessageT >::~PublisherInterfaceBase ( )
virtualdefault

Member Function Documentation

◆ initialize()

template<typename MessageT >
virtual tl::expected<void, std::string> moveit_studio::behaviors::PublisherInterfaceBase< MessageT >::initialize ( const std::string &  topic_name,
const size_t  queue_size,
const bool  use_best_effort 
)
pure virtual

Virtual function to initialize the publisher interface.

Parameters
topic_nameName of the topic to use in the publisher interface.
queue_sizeThe queue size for the publisher interface.
use_best_effortWhether best_effort should be used or not for the publisher interface.
Returns
Void if the publisher interface was initialized successfully. If initialization failed, an error message string is returned.

Implemented in moveit_studio::behaviors::RclcppPublisherInterface< MessageT >.

◆ publish()

template<typename MessageT >
virtual tl::expected<void, std::string> moveit_studio::behaviors::PublisherInterfaceBase< MessageT >::publish ( const MessageT &  message)
pure virtual

Virtual function to publish a message to a topic.

Parameters
messageThe message to publish.
Returns
Void if the publisher sent the message successfully. If message publishing failed, an error message string is returned.

Implemented in moveit_studio::behaviors::RclcppPublisherInterface< MessageT >.


The documentation for this class was generated from the following file: