[ros-users] Parameter resolution order in launch files

Ken Conley kwc at willowgarage.com
Tue Dec 28 06:23:06 UTC 2010


On Mon, Dec 27, 2010 at 10:04 PM, Patrick Bouffard
<bouffard at eecs.berkeley.edu> wrote:
> Suppose a parameter that is read by a node at startup is specified in
> more than one place in a launch file. For example:
>
> <launch>
>  <param name="foo/param" value="0.0"/>
>  <node pkg="foo" type="foo" name="foo">
>    <param name="~param" value="1.0"/>
>    <rosparam>
>        param: 1.5
>    </rosparam>
>  </node>
>  <param name="foo/param" value="2.0"/>
> </launch>
>
> When the node starts up and fetches the parameter, what value will be
> returned, 0.0, 1.0, 1.5, or 2.0?
>
> [...]
>
> Ok, so a bit of searching and I found that the answer should be 2.0,
> based on [1]. However, it would be nice to mention this in the main
> documentation, i.e. [2] rather than in a tutorial.

Good recommendation.  I added a paragraph here.  Please let me know
what you think:

http://www.ros.org/wiki/roslaunch/XML#Evaluation_order

> One follow-on question: in a case like the example above, will
> roslaunch actually send each value of the parameter to the parameter
> server one after the other, or does it just send the final value? Just
> curious.

roslaunch aggregates all the parameter values internally and only
sends the final values to the Parameter Server.

 - Ken



More information about the ros-users mailing list