Set a parameter value for all nodes at once? [ROS2]

asked 2021-06-10 14:35:14 -0500

Is it possible to set the value of a given parameter, at runtime, in all nodes that have that parameter, without looping through each node and calling set param for each?

Using /** as your namespace in a yaml file allows you to set parameters for each node using that parameter file at launch, regardless of its namespace. I was wondering if there is an equivalent way to broadly set parameters at runtime?

e.g. for a swarm of robots (robot1, robot2, ..., robotn), if each is launched with parameters defined in a yaml file like this:

        max_vel: 1

Is there a way to set max_vel for all robots at once?

My first thought was to try the command line interface: ros2 param set /** max_vel 2

But the cli interprets the ** literally and complains there is no Node with that name.

edit retag flag offensive close merge delete