Use dynamic reconfigure set outside ROS
Hi there,
I have got a running ROS system with some dynamic parameters needed to set outside ROS.
For my python script to call dynamic_reconfigure set, I used:
from subprocess import Popen, PIPE
param_set = ["rosrun", "dynamic_reconfigure", "dynparam", "set", "/d455", "step_size", "0.5"]
process_can = Popen(param_set, stdout=PIPE)
output, error = process_can.communicate()
As for the result, the parameter of I used for dynamic_reconfigure set keeps still the same. But weirdly, if I run the same command in the bash shell it works as expected.
I wonder if anyone has countered similar issues or has ideas about it.
Thank you, Victor
Asked by victorvl998 on 2021-10-11 18:00:57 UTC
Comments
One question about why you are trying to do this and what you mean by "outside" of ROS. Even though your code snippet isn't working, the mere fact that you are trying to run
rosrun dynamic_reconfigure dynparam
suggests that the machine you are trying to do this on has ROS installed. In fact, under the hood, thedynparam
executable is actually a Python script that creates a ROS node. Given all of that, is there some reason you can't use thedynamic_reconfigure
Python API directly?Asked by jarvisschultz on 2021-10-11 19:10:09 UTC
What I am trying to do is to set ROS parameters from the remote end through BT. I have installed ROS on my machine and it is running in the background. The python snippet I got is to poll BT messages. Supposedly it should parse BT message and set ROS parameters immediately before the next BT message comes. I would call it "outside" with respect to "my ROS system". I tried both
dynamic_reconfigure dynparam
and its API and still there is no change to my ROS parameters. My thought is that creating a new ROS node when a message is received is not a great idea. What do you think?Asked by victorvl998 on 2021-10-11 20:40:22 UTC
Is the confusion here perhaps that you're expecting
dynamic_reconfigure
to update the values on the parameter server for you?Asked by gvdhoorn on 2021-10-12 02:25:44 UTC
I don't think it should be a question to use
dynamic_reconfigure
to update parameter values. In fact, I followed this tutorial to create a server. I tested it and I can usedynamic_reconfigure gui
to update the values on the parameter. But the same parameter value isn't updated when I usedynamic_reconfigure dyparam
. I don't know if there is a hiccup with this command or the way I am doing it is wrong. Perhaps you have some ideas about it.Asked by victorvl998 on 2021-10-12 16:54:20 UTC