Ask Your Question

Revision history [back]

roslaunch order of rosparams

What is the order that roslaunch parses and loads parameters? I understand that roslaunch doesn't guarantee the order of nodes launched, but are there some guarantees for parameters, specifically related to nodes? Example launch file:

<launch>
  <param name="p1" value="p1" />
  <node pkg="test_node" type="test_node" name="test_node" >
    <param name="p2" value="p2" />
    <rosparam command="load" file="test.yaml" />
    <param name="p3" value="p3" />
  </node>
  <param name="p4" value="p4" />
</launch>

Some specific questions:

  • Are all parameters in the file (and possibly all included launch files) loaded before all the nodes? For example: p1, and p4 loaded before test_node.
  • Are parameters in a node's namespace guaranteed to be loaded before the node is launched? For example: p2, test.yaml and p3 loaded before test_node.
  • If there are multiple parameters with the same name, which one will overwrite the other? For example, if p4 had the same name as p1, which one wins?
  • If a parameter has the same name as one in a yaml file, which will overwrite the other? For example, if p2 or p3 had the same name as a parameter in test.yaml, which one wins?

    <launch> <node pkg="test_node" type="test_node" name="test_node" &gt;="" <param="" name="p2" value="p2"/> <rosparam command="load" file="test.yaml"/> </node> </launch>

roslaunch order of rosparams

What is the order that roslaunch parses and loads parameters? I understand that roslaunch doesn't guarantee the order of nodes launched, but are there some guarantees for parameters, specifically related to nodes? Example launch file:

<launch>
  <param name="p1" value="p1" />
  <node pkg="test_node" type="test_node" name="test_node" >
    <param name="p2" value="p2" />
    <rosparam command="load" file="test.yaml" />
    <param name="p3" value="p3" />
  </node>
  <param name="p4" value="p4" />
</launch>

Some specific questions:

  • Are all parameters in the file (and possibly all included launch files) loaded before all the nodes? For example: p1, and p4 loaded before test_node.
  • Are parameters in a node's namespace guaranteed to be loaded before the node is launched? For example: p2, test.yaml and p3 loaded before test_node.
  • If there are multiple parameters with the same name, which one will overwrite the other? For example, if p4 had the same name as p1, which one wins?
  • If a parameter has the same name as one in a yaml file, which will overwrite the other? For example, if p2 or p3 had the same name as a parameter in test.yaml, which one wins?

    <launch> <node pkg="test_node" type="test_node" name="test_node" &gt;="" <param="" name="p2" value="p2"/> <rosparam command="load" file="test.yaml"/> </node> </launch>