How to pass parameters loaded from a yaml file into a xacro?
If I do this:
<rosparam command="load" file="$(find mypkg)/config/example.yaml" />
Can I then use values set in the yaml as arguments going into a xacro file?
(I haven't experimented much here and I'll update this when I do try it tomorrow, but it seems like the documentation says only the other direction is possible: values can be set on the parameter server from within a launch file, and the local copies of those values can be used inside that same launch file and used as arguments, but there is no read access to the parameter server?)
I'm not sure this is possible. You may get better answers if you elaborate on why you want to do this.
I'd like to have a centralized place (the yaml file) defining critical robot dimensions, then pass these into a xacro file defining the robot, but also allow certain nodes to get some of the same dimensions from the parameter server.
How did you end up solving this? Did you find a satisfactory solution?
I saw another question similar to this http://answers.ros.org/question/26376... and then starting trying out using
eval
in kinetic to try to access the parameter server (see the comments), but so far no luck.It would be nice if there was a
$(load_param /foo/x)
but maybe there would be race conditions with<param ...
setting in the same launch files?