|
C++ YASMIN (Yet Another State MachINe)
|
Template class to publish ROS 2 messages. More...
#include <publisher_state.hpp>


Public Member Functions | |
| PublisherState (const std::string &topic_name, CreateMessageHandler create_message_handler, rclcpp::QoS qos=10, rclcpp::CallbackGroup::SharedPtr callback_group=nullptr) | |
| Construct a new PublisherState with ROS 2 node and specific QoS. | |
| PublisherState (const rclcpp::Node::SharedPtr &node, const std::string &topic_name, CreateMessageHandler create_message_handler, rclcpp::QoS qos=10, rclcpp::CallbackGroup::SharedPtr callback_group=nullptr) | |
| Construct a new PublisherState with ROS 2 node and specific QoS. | |
| std::string | execute (std::shared_ptr< yasmin::blackboard::Blackboard > blackboard) override |
| Execute the publishing operation. | |
Public Member Functions inherited from yasmin::State | |
| State (const std::set< std::string > &outcomes) | |
| Constructs a State with a set of possible outcomes. | |
| StateStatus | get_status () const |
| Gets the current status of the state. | |
| bool | is_idle () const |
| Checks if the state is idle. | |
| bool | is_running () const |
| Checks if the state is currently running. | |
| bool | is_canceled () const |
| Checks if the state has been canceled. | |
| bool | is_completed () const |
| Checks if the state has completed execution. | |
| std::string | operator() (std::shared_ptr< blackboard::Blackboard > blackboard) |
| Executes the state and returns the outcome. | |
| virtual void | cancel_state () |
| Cancels the current state execution. | |
| std::set< std::string > const & | get_outcomes () |
| Gets the set of possible outcomes for this state. | |
| virtual std::string | to_string () |
| Converts the state to a string representation. | |
Protected Attributes | |
| rclcpp::Node::SharedPtr | node_ |
| Shared pointer to the ROS 2 node. | |
Protected Attributes inherited from yasmin::State | |
| std::set< std::string > | outcomes |
| The possible outcomes of this state. | |
Private Types | |
| using | CreateMessageHandler |
| Function type for creating messages for topic. | |
Private Attributes | |
| std::shared_ptr< rclcpp::Publisher< MsgT > > | pub |
| std::string | topic_name |
| CreateMessageHandler | create_message_handler |
Template class to publish ROS 2 messages.
This class provides functionality to publish to a ROS 2 topic of type MsgT and create a custom messages.
| MsgT | The message type of the topic to publish to. |
|
private |
Function type for creating messages for topic.
|
inline |
Construct a new PublisherState with ROS 2 node and specific QoS.
| topic_name | The name of the topic to monitor. |
| create_message_handler | A callback handler to create messages. |
| qos | Quality of Service settings for the topic. |
|
inline |
Construct a new PublisherState with ROS 2 node and specific QoS.
| node | The ROS 2 node. |
| topic_name | The name of the topic to monitor. |
| create_message_handler | A callback handler to create messages. |
| qos | Quality of Service settings for the topic. |
|
inlineoverridevirtual |
Execute the publishing operation.
| blackboard | A shared pointer to the blackboard for data storage. |
Reimplemented from yasmin::State.
|
private |
Callback handler to create messages.
|
protected |
Shared pointer to the ROS 2 node.
|
private |
Publisher to the ROS 2 topic.
|
private |
Name of the topic to monitor.