C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
get_parameters_state.hpp
Go to the documentation of this file.
1// Copyright (C) 2025 Miguel Ángel González Santamarta
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12// You should have received a copy of the GNU General Public License
13// along with this program. If not, see <https://www.gnu.org/licenses/>.
14
15#ifndef YASMIN_ROS__GET_PARAMETER_STATE_HPP_
16#define YASMIN_ROS__GET_PARAMETER_STATE_HPP_
17
18#include <any>
19#include <string>
20#include <unordered_map>
21
22#include "rclcpp/rclcpp.hpp"
23#include "yasmin/blackboard.hpp"
24#include "yasmin/state.hpp"
25#include "yasmin/types.hpp"
28
29namespace yasmin_ros {
30
38public:
42 using Parameters = std::unordered_map<std::string, std::any>;
43
48
49
55 GetParametersState(const Parameters &parameters,
56 rclcpp::Node::SharedPtr node = nullptr);
57
64 std::string execute(yasmin::Blackboard::SharedPtr blackboard) override;
65
66private:
69 std::unordered_map<std::string, std::any> parameters_;
71 rclcpp::Node::SharedPtr node_;
72};
73
74} // namespace yasmin_ros
75
76#endif // YASMIN_ROS__GET_PARAMETER_STATE_HPP_
std::shared_ptr< Blackboard > SharedPtr
Shared pointer type for Blackboard.
Definition blackboard.hpp:85
Represents a state in a state machine.
Definition state.hpp:46
std::unordered_map< std::string, std::any > Parameters
Type alias for a map of parameters.
Definition get_parameters_state.hpp:42
std::string execute(yasmin::Blackboard::SharedPtr blackboard) override
Executes the state to retrieve parameters.
Definition get_parameters_state.cpp:42
std::unordered_map< std::string, std::any > parameters_
Definition get_parameters_state.hpp:69
rclcpp::Node::SharedPtr node_
Shared pointer to the ROS 2 node.
Definition get_parameters_state.hpp:71
GetParametersState(const Parameters &parameters, rclcpp::Node::SharedPtr node=nullptr)
Shared pointer type for GetParametersState.
Definition get_parameters_state.cpp:28
Definition action_state.hpp:37
#define YASMIN_PTR_ALIASES(ClassName)
Macro to define all pointer aliases for a class.
Definition types.hpp:52