16#ifndef YASMIN_VIEWER__YASMIN_VIEWER_PUB_HPP_
17#define YASMIN_VIEWER__YASMIN_VIEWER_PUB_HPP_
24#include "rclcpp/rclcpp.hpp"
30#include "yasmin_msgs/msg/state.hpp"
31#include "yasmin_msgs/msg/state_machine.hpp"
32#include "yasmin_msgs/msg/transition.hpp"
51 yasmin::StateMachine::SharedPtr
fsm,
70 yasmin::StateMachine::SharedPtr
fsm);
86 std::vector<yasmin_msgs::msg::Transition>
95 std::map<std::string, std::vector<yasmin_msgs::msg::Transition>>
97 yasmin::Concurrence::SharedPtr concurrence)
const;
108 void parse_state(
const std::string &name, yasmin::State::SharedPtr state,
110 std::vector<yasmin_msgs::msg::State> &states_list,
124 rclcpp::Publisher<yasmin_msgs::msg::StateMachine>::SharedPtr
publisher;
129 yasmin::StateMachine::SharedPtr
fsm;
std::map< std::string, std::vector< yasmin_msgs::msg::Transition > > parse_concurrence_transitions(yasmin::Concurrence::SharedPtr concurrence) const
Parses concurrence transitions from outcome map to transition-like information.
Definition yasmin_viewer_pub.cpp:75
std::string fsm_name
Name of the finite state machine.
Definition yasmin_viewer_pub.hpp:131
void parse_state(const std::string &name, yasmin::State::SharedPtr state, const yasmin::Transitions &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.
Definition yasmin_viewer_pub.cpp:92
rclcpp::TimerBase::SharedPtr timer
Timer for periodic publishing.
Definition yasmin_viewer_pub.hpp:126
YasminViewerPub(const rclcpp::Node::SharedPtr &node, yasmin::StateMachine::SharedPtr fsm, const std::string &fsm_name)
Constructs YasminViewerPub with a given ROS 2 node, state machine name, and state machine instance.
Definition yasmin_viewer_pub.cpp:36
yasmin::StateMachine::SharedPtr fsm
Shared pointer to the state machine.
Definition yasmin_viewer_pub.hpp:129
void publish_data()
Publishes the data of the finite state machine to the associated ROS topic.
Definition yasmin_viewer_pub.cpp:175
rclcpp::Node::SharedPtr node_
Shared pointer to the ROS 2 node.
Definition yasmin_viewer_pub.hpp:122
std::vector< yasmin_msgs::msg::Transition > parse_transitions(const yasmin::Transitions &transitions) const
Parses transitions from a map of transitions and returns a list of Transition messages.
Definition yasmin_viewer_pub.cpp:61
rclcpp::Publisher< yasmin_msgs::msg::StateMachine >::SharedPtr publisher
Publisher for StateMachine messages.
Definition yasmin_viewer_pub.hpp:124
Definition yasmin_viewer_pub.hpp:34
StringMap Transitions
Map of transitions (string to string)
Definition types.hpp:84