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
class moveit_pro::behaviors::SendMessageToTopicBehaviorBase<MessageT> { ... }
Included Headers
Base class
| class | SharedResourcesNode<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::NodeStatus | tick () 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 auto | kPortIDMessage = "message" |
|
Port names. More... | |
template <typename MessageT> | |
| static constexpr auto | kPortIDTopicName = "topic" |
template <typename MessageT> | |
| static constexpr auto | kPortIDQueueSize = "queue_size" |
template <typename MessageT> | |
| static constexpr auto | kPortIDUseBestEffort = "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.
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 Name | Port Type | Object Type |
|---|---|---|
| message | Input | MessageT |
| topic | Input | std::string |
| queue_size | Input | size_t |
| use_best_effort | Input | bool |
Definition at line 46 of file send_message_to_topic.hpp.
Public Constructors
SendMessageToTopicBehaviorBase()
|
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()
|
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()
| virtual default |
Definition at line 64 of file send_message_to_topic.hpp.
Public Member Functions
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_
|
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
| constexpr static |
Port names.
Definition at line 50 of file send_message_to_topic.hpp.
kPortIDQueueSize
| constexpr static |
Definition at line 52 of file send_message_to_topic.hpp.
kPortIDTopicName
| constexpr static |
Definition at line 51 of file send_message_to_topic.hpp.
kPortIDUseBestEffort
| 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.