Skip to main content

SendMessageToTopicBehaviorBase Class Template

Base class for Behaviors that send a message to a topic. The message contents and topic name are specified as input ports. More...

Declaration​

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

Included Headers​

#include <send_message_to_topic.hpp>

Base class​

classSharedResourcesNode<BehaviorTreeNodeT>

The SharedResourcesNode class provides a BehaviorContext object when constructing a BehaviorTree.Cpp node. More...

Public Constructors Index​

template <typename MessageT>
SendMessageToTopicBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &behavior_context)

Constructs SendMessageToTopicBehaviorBase using the RclcppPublisherInterface. More...

template <typename MessageT>
SendMessageToTopicBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &behavior_context, std::unique_ptr< PublisherInterfaceBase< MessageT > > publisher_interface)

Constructs SendMessageToTopicBehaviorBase using a user-provided implementation of PublisherInterfaceBase. More...

Public Destructor Index​

template <typename MessageT>
~SendMessageToTopicBehaviorBase ()=default

Public Member Functions Index​

template <typename MessageT>
BT::NodeStatustick () override

Private Member Attributes Index​

template <typename MessageT>
std::unique_ptr< PublisherInterfaceBase< MessageT > >publisher_interface_

Publisher interface used by the Behavior to send a message to a topic. More...

Public Static Attributes Index​

template <typename MessageT>
static constexpr autokPortIDMessage = "message"

Port names. More...

template <typename MessageT>
static constexpr autokPortIDTopicName = "topic"
template <typename MessageT>
static constexpr autokPortIDQueueSize = "queue_size"
template <typename MessageT>
static constexpr autokPortIDUseBestEffort = "use_best_effort"

Description​

Base class for Behaviors that send a message to a topic. The message contents and topic name are specified as input ports.

Template Parameters
MessageT

ROS message type used to specialize this class.

info

The default message input data port type is MessageT. This means you might need to create a separate Behavior that generates an MessageT instance. If you do not want to create a separate Behavior to generate an instance of MessageT, consider creating a template specialization of BT::convertFromString which converts a string to a MessageT instance. This allows for the message input data port to take a std::string as its input. For an example of how this is done, look at the PublishString Behavior. If the "message" input port is not set, then the Behavior will publish a default instance of the specified message type.

The "queue_size" (for the underlying publisher's quality of service) input port value must be > 0.

If The "use_best_effort" (for the underlying publisher's quality of service) is set to true, "best effort" reliability is used. If false, "reliable" reliability is used.

Data Port NamePort TypeObject Type
messageInputMessageT
topicInputstd::string
queue_sizeInputsize_t
use_best_effortInputbool

Definition at line 46 of file send_message_to_topic.hpp.

Public Constructors​

SendMessageToTopicBehaviorBase()​

template <typename MessageT>
moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::SendMessageToTopicBehaviorBase (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & behavior_context)

Constructs SendMessageToTopicBehaviorBase using the RclcppPublisherInterface.

Declaration at line 56 of file send_message_to_topic.hpp, definition at line 16 of file send_message_to_topic_impl.hpp.

SendMessageToTopicBehaviorBase()​

template <typename MessageT>
moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::SendMessageToTopicBehaviorBase (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & behavior_context, std::unique_ptr< PublisherInterfaceBase< MessageT > > publisher_interface)

Constructs SendMessageToTopicBehaviorBase using a user-provided implementation of PublisherInterfaceBase.

Declaration at line 60 of file send_message_to_topic.hpp, definition at line 25 of file send_message_to_topic_impl.hpp.

Public Destructor​

~SendMessageToTopicBehaviorBase()​

template <typename MessageT>
virtual moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::~SendMessageToTopicBehaviorBase ()
virtual default

Definition at line 64 of file send_message_to_topic.hpp.

Public Member Functions​

tick()​

template <typename MessageT>
BT::NodeStatus moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::tick ()

Declaration at line 66 of file send_message_to_topic.hpp, definition at line 35 of file send_message_to_topic_impl.hpp.

Private Member Attributes​

publisher_interface_​

template <typename MessageT>
std::unique_ptr<PublisherInterfaceBase<MessageT> > moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::publisher_interface_

Publisher interface used by the Behavior to send a message to a topic.

Definition at line 70 of file send_message_to_topic.hpp.

Public Static Attributes​

kPortIDMessage​

template <typename MessageT>
constexpr auto moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::kPortIDMessage = "message"
constexpr static

Port names.

Definition at line 50 of file send_message_to_topic.hpp.

kPortIDQueueSize​

template <typename MessageT>
constexpr auto moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::kPortIDQueueSize = "queue_size"
constexpr static

Definition at line 52 of file send_message_to_topic.hpp.

kPortIDTopicName​

template <typename MessageT>
constexpr auto moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::kPortIDTopicName = "topic"
constexpr static

Definition at line 51 of file send_message_to_topic.hpp.

kPortIDUseBestEffort​

template <typename MessageT>
constexpr auto moveit_pro::behaviors::SendMessageToTopicBehaviorBase< MessageT >::kPortIDUseBestEffort = "use_best_effort"
constexpr static

Definition at line 53 of file send_message_to_topic.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.