How can I set several parameters with a single call of rosparam?
I would like to set several ROS parameters via a single call of rosparam
(run in a docker container means loading from .yaml with rosparam load dump.yaml
is no option for me). Can I use rosparam set <...>
to get this done somehow? (The wiki cli docs probably lack something which I could use.)
I tired a single line invocation like follows but got an yaml.scanner.ScannerError
:
$ rosparam set /gains "p: 1.0 i: 1.0 d: 1.0"
...
yaml.scanner.ScannerError: mapping values are not allowed here
in "<string>", line 1, column 9:
p: 1.0 i: 1.0 d: 1.0
^
can you explain this? As long as the master is accessible you could even run
rosparam
outside your container and load entire dumps.can you explain this? I could do so. But I prefer to have the docker environment completely separated from my local workstation OS environment. And if I'd like to load dumps I'd need to handle docker volumes/mounts which I don't like to do in this case.
rosparam set /gains "{p : 1.0, i : 1.0, d : 1.0}"
works just fine btw. If you post it as answer I'll accept it...use one container to run
rosparam
and target another container? Only volume mount (-v
) would be the.yaml
file containing the parameters?Btw: you could also use
rospy.set_param(..)
. As it's an XMLRPC call, it can be used without creating a ROS node.I would not be surprised if you could use a bare XMLRPC call with the yaml dictionary directly. No ROS needed in that case (but I haven't tried it).