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

ROS2 parameter service: where is it?

asked 2019-03-12 21:00:49 -0500

huchaohong gravatar image

I am new to ros2 and I am confused about parameter service implementation in ROS2 now. In ROS1, there is a parameter server in master node which is removed in ROS2.

I don't know if there is a specific parameter server somewhere exists in ROS2. If not, how can each node communicate to each other's paramter? I have read for reference. There is a "wait_for_service" api in client, where is this service? Is there one parameter service for each node?

Please help me as i can't find much reference in other place.

edit retag flag offensive close merge delete


Not an answer, but take a look at Parameter API design in ROS for the general design for parameters in ROS 2 and how that differs from the ROS 1 approach.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-13 03:18:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-05-17 12:02:03 -0500

William gravatar image

There's not a single global parameter server in ROS 2, rather having a centralized (single point of failure) for parameters, in ROS 2 all parameters are owned by a node. You could have a special node that acts like the parameter server in ROS 1, i.e. accepts all parameters set on it and can have parameters initialized by yaml file. I made a demo that does exactly that in this pr recently:

We don't have a node that you can run as part of something like roscore from ROS 1 in ROS 2, but we may in the future. In the meantime, I'd recommend (re)-evaluating each of your parameters to see if they actually need to be global, and if not just use them locally in your node. There are some cases where global makes sense, and in those cases you can either duplicate the parameter in each node (e.g. this is what we do for use_sim_time and it works well if multiple nodes are just reading the parameter) or you can setup a node like the one in my demo above and read/write on it from all of your nodes.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-03-12 21:00:49 -0500

Seen: 826 times

Last updated: May 17 '19