[ros-users] Parameter resolution order in launch files

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: ros-users
Subject: [ros-users] Parameter resolution order in launch files
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.

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.

Thanks,
Pat

[1] http://www.ros.org/wiki/roslaunch/Tutorials/Roslaunch%20tips%20for%20larger%20projects
[2] http://www.ros.org/wiki/roslaunch/XML#Setting_parameters