Use dynamic reconfigure set outside ROS

asked 2021-10-11 18:00:57 -0500

victorvl998 gravatar image

updated 2021-10-11 20:15:15 -0500

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

edit retag flag offensive close merge delete

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, the dynparam executable is actually a Python script that creates a ROS node. Given all of that, is there some reason you can't use the dynamic_reconfigurePython API directly?

jarvisschultz gravatar image jarvisschultz  ( 2021-10-11 19:10:09 -0500 )edit

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?

victorvl998 gravatar image victorvl998  ( 2021-10-11 20:40:22 -0500 )edit

Is the confusion here perhaps that you're expecting dynamic_reconfigure to update the values on the parameter server for you?

gvdhoorn gravatar image gvdhoorn  ( 2021-10-12 02:25:44 -0500 )edit

I don't think it should be a question to use dynamic_reconfigureto update parameter values. In fact, I followed this [tutorial to create a server] (http://wiki.ros.org/dynamic_reconfigu...). I tested it and I can use dynamic_reconfigure gui to update the values on the parameter. But the same parameter value isn't updated when I use dynamic_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.

victorvl998 gravatar image victorvl998  ( 2021-10-12 16:54:20 -0500 )edit