Publishes state machine data for visualization.
More...
#include <yasmin_viewer_pub.hpp>
|
| | YasminViewerPub (const rclcpp::Node::SharedPtr &node, std::shared_ptr< yasmin::StateMachine > fsm, const std::string &fsm_name) |
| | Constructs YasminViewerPub with a given ROS 2 node, state machine name, and state machine instance.
|
| |
| | YasminViewerPub (std::shared_ptr< yasmin::StateMachine > fsm, const std::string &fsm_name) |
| | Constructs YasminViewerPub with a default ROS 2 node instance, state machine name, and state machine instance.
|
| |
| | YasminViewerPub (const rclcpp::Node::SharedPtr &node, std::shared_ptr< yasmin::StateMachine > fsm) |
| | Constructs YasminViewerPub with a given ROS 2 node, state machine name, and state machine instance.
|
| |
| | YasminViewerPub (std::shared_ptr< yasmin::StateMachine > fsm) |
| | Constructs YasminViewerPub with a default ROS 2 node instance, state machine name, and state machine instance.
|
| |
| std::vector< yasmin_msgs::msg::Transition > | parse_transitions (const std::map< std::string, std::string > &transitions) |
| | Parses transitions from a map of transitions and returns a list of Transition messages.
|
| |
| std::map< std::string, std::vector< yasmin_msgs::msg::Transition > > | parse_concurrence_transitions (std::shared_ptr< yasmin::Concurrence > concurrence) |
| | Parses concurrence transitions from outcome map to transition-like information.
|
| |
| void | parse_state (const std::string &name, std::shared_ptr< yasmin::State > state, const std::map< std::string, std::string > &transitions, std::vector< yasmin_msgs::msg::State > &states_list, int parent) |
| | Parses a state and its transitions to add it to the list of state messages.
|
| |
| void | publish_data () |
| | Publishes the data of the finite state machine to the associated ROS topic.
|
| |
|
| rclcpp::Node::SharedPtr | node_ |
| | Shared pointer to the ROS 2 node.
|
| |
| rclcpp::Publisher< yasmin_msgs::msg::StateMachine >::SharedPtr | publisher |
| | Publisher for StateMachine messages.
|
| |
| rclcpp::TimerBase::SharedPtr | timer |
| | Timer for periodic publishing.
|
| |
| std::shared_ptr< yasmin::StateMachine > | fsm |
| | Shared pointer to the state machine.
|
| |
| std::string | fsm_name |
| | Name of the finite state machine.
|
| |
Publishes state machine data for visualization.
◆ YasminViewerPub() [1/4]
| YasminViewerPub::YasminViewerPub |
( |
const rclcpp::Node::SharedPtr & | node, |
|
|
std::shared_ptr< yasmin::StateMachine > | fsm, |
|
|
const std::string & | fsm_name ) |
Constructs YasminViewerPub with a given ROS 2 node, state machine name, and state machine instance.
- Parameters
-
| node | Shared pointer to the ROS 2 node. |
| fsm_name | Name of the finite state machine. |
| fsm | Shared pointer to the StateMachine instance to be published. |
◆ YasminViewerPub() [2/4]
| YasminViewerPub::YasminViewerPub |
( |
std::shared_ptr< yasmin::StateMachine > | fsm, |
|
|
const std::string & | fsm_name ) |
Constructs YasminViewerPub with a default ROS 2 node instance, state machine name, and state machine instance.
- Parameters
-
| fsm_name | Name of the finite state machine. |
| fsm | Shared pointer to the StateMachine instance to be published. |
◆ YasminViewerPub() [3/4]
| YasminViewerPub::YasminViewerPub |
( |
const rclcpp::Node::SharedPtr & | node, |
|
|
std::shared_ptr< yasmin::StateMachine > | fsm ) |
Constructs YasminViewerPub with a given ROS 2 node, state machine name, and state machine instance.
- Parameters
-
| node | Shared pointer to the ROS 2 node. |
| fsm | Shared pointer to the StateMachine instance to be published. |
◆ YasminViewerPub() [4/4]
Constructs YasminViewerPub with a default ROS 2 node instance, state machine name, and state machine instance.
- Parameters
-
| fsm | Shared pointer to the StateMachine instance to be published. |
◆ parse_concurrence_transitions()
| std::map< std::string, std::vector< yasmin_msgs::msg::Transition > > YasminViewerPub::parse_concurrence_transitions |
( |
std::shared_ptr< yasmin::Concurrence > | concurrence | ) |
|
Parses concurrence transitions from outcome map to transition-like information.
- Parameters
-
| concurrence | Shared pointer to the Concurrence state. |
- Returns
- Map of state names to their transition vectors.
◆ parse_state()
| void YasminViewerPub::parse_state |
( |
const std::string & | state_name, |
|
|
std::shared_ptr< yasmin::State > | state, |
|
|
const std::map< std::string, std::string > & | transitions, |
|
|
std::vector< yasmin_msgs::msg::State > & | states_list, |
|
|
int | parent ) |
Parses a state and its transitions to add it to the list of state messages.
Parses a state and its transitions, adding it to the states list and handling nested FSMs if applicable.
- Parameters
-
| name | Name of the state to be parsed. |
| state | Shared pointer to the State instance. |
| transitions | Map of transitions associated with this state. |
| states_list | Vector to which the parsed State message will be added. |
| parent | ID of the parent state. |
| state_name | Name of the state. |
| state | Shared pointer to the State instance. |
| transitions | Map of transitions related to the state. |
| states_list | Reference to a vector of yasmin_msgs::msg::State to append parsed states. |
| parent | ID of the parent state; -1 for top-level states. |
◆ parse_transitions()
| std::vector< yasmin_msgs::msg::Transition > YasminViewerPub::parse_transitions |
( |
const std::map< std::string, std::string > & | transitions | ) |
|
Parses transitions from a map of transitions and returns a list of Transition messages.
Parses a map of transition pairs (outcome, state) to a vector of Transition messages.
- Parameters
-
| transitions | Map where keys are transition outcomes, and values are the next states. |
- Returns
- Vector of Transition messages.
- Parameters
-
| transitions | Map containing transition outcomes as keys and next states as values. |
- Returns
- Vector of yasmin_msgs::msg::Transition.
◆ publish_data()
| void YasminViewerPub::publish_data |
( |
| ) |
|
Publishes the data of the finite state machine to the associated ROS topic.
Publishes the state machine data if validation is successful.
- Exceptions
-
| std::exception | if state machine validation fails. |
| std::exception | Thrown if the state machine fails validation. |
◆ fsm
Shared pointer to the state machine.
◆ fsm_name
| std::string yasmin_viewer::YasminViewerPub::fsm_name |
|
private |
Name of the finite state machine.
◆ node_
| rclcpp::Node::SharedPtr yasmin_viewer::YasminViewerPub::node_ |
|
private |
Shared pointer to the ROS 2 node.
◆ publisher
| rclcpp::Publisher<yasmin_msgs::msg::StateMachine>::SharedPtr yasmin_viewer::YasminViewerPub::publisher |
|
private |
Publisher for StateMachine messages.
◆ timer
| rclcpp::TimerBase::SharedPtr yasmin_viewer::YasminViewerPub::timer |
|
private |
Timer for periodic publishing.
The documentation for this class was generated from the following files: