C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin_ros::GetParametersState Class Reference

State that retrieves parameters from the ROS 2 parameter server. More...

#include <get_parameters_state.hpp>

Inheritance diagram for yasmin_ros::GetParametersState:
Collaboration diagram for yasmin_ros::GetParametersState:

Public Member Functions

 GetParametersState (const std::map< std::string, std::any > &parameters, rclcpp::Node::SharedPtr node=nullptr)
 Constructs a GetParametersState with a map of parameters.
 
std::string execute (std::shared_ptr< yasmin::blackboard::Blackboard > blackboard) override
 Executes the state to retrieve parameters.
 
- 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.
 

Private Attributes

std::map< std::string, std::any > parameters_
 
rclcpp::Node::SharedPtr node_
 Shared pointer to the ROS 2 node.
 

Additional Inherited Members

- Protected Attributes inherited from yasmin::State
std::set< std::string > outcomes
 The possible outcomes of this state.
 

Detailed Description

State that retrieves parameters from the ROS 2 parameter server.

This state retrieves parameters from the ROS 2 parameter server and stores them in the blackboard.

Constructor & Destructor Documentation

◆ GetParametersState()

GetParametersState::GetParametersState ( const std::map< std::string, std::any > & parameters,
rclcpp::Node::SharedPtr node = nullptr )

Constructs a GetParametersState with a map of parameters.

Parameters
parametersA map of parameter names to their default values.
nodeA shared pointer to the ROS 2 node.

Member Function Documentation

◆ execute()

std::string GetParametersState::execute ( std::shared_ptr< yasmin::blackboard::Blackboard > blackboard)
overridevirtual

Executes the state to retrieve parameters.

Parameters
blackboardA reference to the Yasmin blackboard.
Returns
A string representing the outcome of the execution.

Reimplemented from yasmin::State.

Member Data Documentation

◆ node_

rclcpp::Node::SharedPtr yasmin_ros::GetParametersState::node_
private

Shared pointer to the ROS 2 node.

◆ parameters_

std::map<std::string, std::any> yasmin_ros::GetParametersState::parameters_
private

Map of parameters to retrieve, where the key is the parameter name and the value is the default value.


The documentation for this class was generated from the following files: