rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_HPP_
26 #include "rcl_interfaces/msg/list_parameters_result.hpp"
27 #include "rcl_interfaces/msg/parameter_descriptor.hpp"
28 #include "rcl_interfaces/msg/parameter_event.hpp"
29 #include "rcl_interfaces/msg/set_parameters_result.hpp"
44 namespace node_interfaces
62 : allow_modification_(allow_mod)
64 if (!allow_modification_) {
66 "cannot set or declare a parameter, or change the callback from within set callback");
69 allow_modification_ =
false;
74 allow_modification_ =
true;
78 bool & allow_modification_;
89 const node_interfaces::NodeBaseInterface::SharedPtr node_base,
90 const node_interfaces::NodeLoggingInterface::SharedPtr node_logging,
91 const node_interfaces::NodeTopicsInterface::SharedPtr node_topics,
92 const node_interfaces::NodeServicesInterface::SharedPtr node_services,
93 const node_interfaces::NodeClockInterface::SharedPtr node_clock,
95 bool start_parameter_services,
96 bool start_parameter_event_publisher,
99 bool allow_undeclared_parameters,
100 bool automatically_declare_parameters_from_overrides);
109 # pragma GCC diagnostic push
110 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
112 # pragma warning(push)
113 # pragma warning(disable: 4996)
120 # pragma GCC diagnostic pop
122 # pragma warning(pop)
130 const rcl_interfaces::msg::ParameterDescriptor & parameter_descriptor =
131 rcl_interfaces::msg::ParameterDescriptor{},
132 bool ignore_override =
false)
override;
139 const rcl_interfaces::msg::ParameterDescriptor & parameter_descriptor =
140 rcl_interfaces::msg::ParameterDescriptor(),
141 bool ignore_override =
false)
override;
157 rcl_interfaces::msg::SetParametersResult
190 rcl_interfaces::msg::ListParametersResult
195 OnSetParametersCallbackHandle::SharedPtr
216 bool parameter_modification_enabled_{
true};
226 bool allow_undeclared_ =
false;
234 node_interfaces::NodeLoggingInterface::SharedPtr node_logging_;
235 node_interfaces::NodeClockInterface::SharedPtr node_clock_;
241 #endif // RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_HPP_
Store the type and value of a parameter.
Definition: parameter_value.hpp:71
A publisher publishes messages of any type to a topic.
Definition: publisher.hpp:53
#define RCLCPP_INTERNAL_NODE_PARAMETERS_INTERFACE_DEPRECATE_DECLARE
Definition: node_parameters_interface.hpp:48
rclcpp::ParameterValue value
Current value of the parameter.
Definition: node_parameters.hpp:51
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
ParameterMutationRecursionGuard(bool &allow_mod)
Definition: node_parameters.hpp:61
Definition: node_parameters.hpp:48
rcl_interfaces::msg::ParameterDescriptor descriptor
A description of the parameter.
Definition: node_parameters.hpp:54
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
Non-templated part of PublisherOptionsWithAllocator<Allocator>.
Definition: publisher_options.hpp:37
Implementation of the NodeParameters part of the Node API.
Definition: node_parameters.hpp:82
const rclcpp::ParameterValue & declare_parameter(const std::string &name) override
Declare a parameter.
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
const std::map< std::string, rclcpp::ParameterValue > & get_parameter_overrides() const override
Return the initial parameter values used by the NodeParameters to override default values.
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Definition: node_parameters_interface.hpp:36
Encapsulation of Quality of Service settings.
Definition: qos.hpp:110
void undeclare_parameter(const std::string &name) override
Undeclare a parameter.
std::vector< uint8_t > get_parameter_types(const std::vector< std::string > &names) const override
std::vector< rcl_interfaces::msg::SetParametersResult > set_parameters(const std::vector< rclcpp::Parameter > ¶meters) override
Set one or more parameters, one at a time.
Pure virtual interface class for the NodeParameters part of the Node API.
Definition: node_parameters_interface.hpp:60
void remove_on_set_parameters_callback(const OnSetParametersCallbackHandle *const handler) override
Remove a callback registered with add_on_set_parameters_callback.
Thrown if parameter is modified while in a set callback.
Definition: exceptions.hpp:279
std::vector< rcl_interfaces::msg::ParameterDescriptor > describe_parameters(const std::vector< std::string > &names) const override
#define RCUTILS_WARN_UNUSED
ParameterType
Definition: parameter_value.hpp:32
Definition: node_parameters.hpp:58
std::vector< rclcpp::Parameter > get_parameters(const std::vector< std::string > &names) const override
Get descriptions of parameters given their names.
rcl_interfaces::msg::SetParametersResult set_parameters_atomically(const std::vector< rclcpp::Parameter > ¶meters) override
Set one or more parameters, all at once.
rcl_interfaces::msg::ListParametersResult list_parameters(const std::vector< std::string > &prefixes, uint64_t depth) const override
virtual ~NodeParameters()
rclcpp::Parameter get_parameter(const std::string &name) const override
Get the description of one parameter given a name.
Structure to store an arbitrary parameter with templated get/set methods.
Definition: parameter.hpp:52
std::list< OnSetParametersCallbackHandle::WeakPtr > CallbacksContainerType
Definition: node_parameters.hpp:206
bool get_parameters_by_prefix(const std::string &prefix, std::map< std::string, rclcpp::Parameter > ¶meters) const override
Get all parameters that have the specified prefix into the parameters map.
RCUTILS_WARN_UNUSED OnSetParametersCallbackHandle::SharedPtr add_on_set_parameters_callback(OnParametersSetCallbackType callback) override
Add a callback for when parameters are being set.
~ParameterMutationRecursionGuard()
Definition: node_parameters.hpp:72
bool has_parameter(const std::string &name) const override
Return true if the parameter has been declared, otherwise false.
OnSetParametersCallbackHandle::OnParametersSetCallbackType OnParametersSetCallbackType
Definition: node_parameters_interface.hpp:208
NodeParameters(const node_interfaces::NodeBaseInterface::SharedPtr node_base, const node_interfaces::NodeLoggingInterface::SharedPtr node_logging, const node_interfaces::NodeTopicsInterface::SharedPtr node_topics, const node_interfaces::NodeServicesInterface::SharedPtr node_services, const node_interfaces::NodeClockInterface::SharedPtr node_clock, const std::vector< Parameter > ¶meter_overrides, bool start_parameter_services, bool start_parameter_event_publisher, const rclcpp::QoS ¶meter_event_qos, const rclcpp::PublisherOptionsBase ¶meter_event_publisher_options, bool allow_undeclared_parameters, bool automatically_declare_parameters_from_overrides)