ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is the closest equivalent:

http://docs.ros2.org/dashing/api/rclcpp/classrclcpp_1_1SyncParametersClient.html#a267b96b3d93929404ac8ac4e83214831

In that is can set one or more parameters on any node (remote or local) by name and will return when the setting of the parameter is complete (synchronous).

There is an Asynchronous version as well which returns a future:

http://docs.ros2.org/dashing/api/rclcpp/classrclcpp_1_1AsyncParametersClient.html#a192ef60deac868dd9ad1071fc6e88c4e

Here's the examples:

https://github.com/ros2/demos/blob/f78dcc981cc783aad162e2a8530a7aa23c4fda21/demo_nodes_cpp/src/parameters/set_and_get_parameters.cpp#L40-L72

Note that in this example it is getting and setting parameters on the local node, but you can also use the same class to get and set parameters on remote nodes given their name.