externally set param on dynamic_reconfigure node

asked 2020-03-24 19:20:21 -0500

mogumbo gravatar image

I can set a param on a node using rosparam on the command line or using rospy.set_param. However, I want to update my dynamic_reconfigure node with external scripts or nodes. Ideally, I want to set params on my dynamic_reconfigure node and have the change propagate to the rest of my sim. For example, I want to do:

rosparam set /my_dynrec_node/my_bool True

and see my_bool change in rqt_reconfigure and have my node emit /my_dynrec_node/parameter_updates. How can I do this?

I suspect this would involve calling dynamic_reconfigure::Server::updateConfig, but I don't see any mechanism for making this happen.

edit retag flag offensive close merge delete


Are you talking about doing this programmatically or from the CLI? For dynamic_reconfigureable parameters, there is the dynparam command line utility. Does this already do what you want?

mgruhler gravatar image mgruhler  ( 2020-03-25 02:12:36 -0500 )edit

In addition: dynamic_reconfigure exposes a set of services. Those services can be called by any client.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-25 06:10:23 -0500 )edit

Thank you both. I feel a little dumb for not spotting some of this in the docs yesterday. dynparam does what I need. I also used dynamic_reconfigure.client in a python script to set my node's params and it has the same effect. Is that what you meant by using services, or is there yet another way to do all this?

mogumbo gravatar image mogumbo  ( 2020-03-25 13:37:24 -0500 )edit