15 #ifndef RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_INTERFACE_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_INTERFACE_HPP_
23 #include "rcl_interfaces/msg/list_parameters_result.hpp"
24 #include "rcl_interfaces/msg/parameter_descriptor.hpp"
25 #include "rcl_interfaces/msg/set_parameters_result.hpp"
27 #include "rclcpp/macros.hpp"
28 #include "rclcpp/parameter.hpp"
29 #include "rclcpp/visibility_control.hpp"
33 namespace node_interfaces
40 using OnParametersSetCallbackType =
42 rcl_interfaces::msg::SetParametersResult(
43 const std::vector<rclcpp::Parameter> &)>;
45 OnParametersSetCallbackType callback;
66 const std::string & name,
68 const rcl_interfaces::msg::ParameterDescriptor & parameter_descriptor =
69 rcl_interfaces::msg::ParameterDescriptor(),
70 bool ignore_override =
false) = 0;
80 const std::string & name,
81 rclcpp::ParameterType type,
82 const rcl_interfaces::msg::ParameterDescriptor & parameter_descriptor =
83 rcl_interfaces::msg::ParameterDescriptor(),
84 bool ignore_override =
false) = 0;
110 std::vector<rcl_interfaces::msg::SetParametersResult>
119 rcl_interfaces::msg::SetParametersResult
121 const std::vector<rclcpp::Parameter> & parameters) = 0;
131 std::vector<rclcpp::Parameter>
156 const std::string & name,
170 const std::string & prefix,
171 std::map<std::string, rclcpp::Parameter> & parameters)
const = 0;
175 std::vector<rcl_interfaces::msg::ParameterDescriptor>
176 describe_parameters(
const std::vector<std::string> & names)
const = 0;
181 get_parameter_types(
const std::vector<std::string> & names)
const = 0;
185 rcl_interfaces::msg::ListParametersResult
186 list_parameters(
const std::vector<std::string> & prefixes, uint64_t depth)
const = 0;
188 using OnParametersSetCallbackType = OnSetParametersCallbackHandle::OnParametersSetCallbackType;
196 OnSetParametersCallbackHandle::SharedPtr
211 const std::map<std::string, rclcpp::ParameterValue> &
Store the type and value of a parameter.
Structure to store an arbitrary parameter with templated get/set methods.
Pure virtual interface class for the NodeParameters part of the Node API.
virtual RCLCPP_PUBLIC const rclcpp::ParameterValue & declare_parameter(const std::string &name, rclcpp::ParameterType type, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor(), bool ignore_override=false)=0
Declare a parameter.
virtual RCLCPP_PUBLIC OnSetParametersCallbackHandle::SharedPtr add_on_set_parameters_callback(OnParametersSetCallbackType callback)=0
Add a callback for when parameters are being set.
virtual RCLCPP_PUBLIC void remove_on_set_parameters_callback(const OnSetParametersCallbackHandle *const handler)=0
Remove a callback registered with add_on_set_parameters_callback.
virtual RCLCPP_PUBLIC void undeclare_parameter(const std::string &name)=0
Undeclare a parameter.
virtual RCLCPP_PUBLIC const rclcpp::ParameterValue & declare_parameter(const std::string &name, const rclcpp::ParameterValue &default_value, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor(), bool ignore_override=false)=0
Declare and initialize a parameter.
virtual RCLCPP_PUBLIC std::vector< rclcpp::Parameter > get_parameters(const std::vector< std::string > &names) const =0
Get descriptions of parameters given their names.
virtual RCLCPP_PUBLIC bool get_parameter(const std::string &name, rclcpp::Parameter ¶meter) const =0
Get the description of one parameter given a name.
virtual RCLCPP_PUBLIC rclcpp::Parameter get_parameter(const std::string &name) const =0
Get the description of one parameter given a name.
virtual RCLCPP_PUBLIC bool has_parameter(const std::string &name) const =0
Return true if the parameter has been declared, otherwise false.
virtual RCLCPP_PUBLIC rcl_interfaces::msg::SetParametersResult set_parameters_atomically(const std::vector< rclcpp::Parameter > ¶meters)=0
Set one or more parameters, all at once.
virtual RCLCPP_PUBLIC bool get_parameters_by_prefix(const std::string &prefix, std::map< std::string, rclcpp::Parameter > ¶meters) const =0
Get all parameters that have the specified prefix into the parameters map.
virtual RCLCPP_PUBLIC const std::map< std::string, rclcpp::ParameterValue > & get_parameter_overrides() const =0
Return the initial parameter values used by the NodeParameters to override default values.
virtual RCLCPP_PUBLIC std::vector< rcl_interfaces::msg::SetParametersResult > set_parameters(const std::vector< rclcpp::Parameter > ¶meters)=0
Set one or more parameters, one at a time.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.