Robotics StackExchange | Archived questions

externally set param on dynamic_reconfigure node

I can set a param on a node using rosparam on the command line or using rospy.setparam. However, I want to update my dynamicreconfigure 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 mybool change in rqtreconfigure and have my node emit /mydynrecnode/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.

Asked by mogumbo on 2020-03-24 19:20:21 UTC

Comments

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?

Asked by mgruhler on 2020-03-25 02:12:36 UTC

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

Asked by gvdhoorn on 2020-03-25 06:10:23 UTC

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?

Asked by mogumbo on 2020-03-25 13:37:24 UTC

Answers