ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Local vs. Global Parameters? In a Launch File?

asked 2011-11-25 11:11:50 -0500

gavinmachine gravatar image


What is the difference between setting a parameter in a launch file like this (i.e. outside of a node tag):

<param name="param01" value="value01" />
<node name="node01" pkg="package01" type="node01" />

and this (i.e. wrapped inside of a node tag):

<node name="node01" pkg="package01" type="node01">
      <param name="param01" value="value01" />

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-11-25 12:24:30 -0500

joq gravatar image

The first example defines a "relative" name.

The second defines a "private" parameter.

Most ROS nodes look for parameters in their private namespace, so the second is generally preferred. But, there are sometimes reasons to define parameters at a higher level, as in the first example.

edit flag offensive delete link more


Would the top parameter also be considered a global? Also, does that mean that private param names should always start with "~" and global with "/" (following the link you provided)?
gavinmachine gravatar image gavinmachine  ( 2011-11-25 13:01:24 -0500 )edit
It's relative, not global. When pushed into a namespace it will not be at the top level anymore (unless you use the /). When using the second variant, the parameters are private without the ~ already.
dornhege gravatar image dornhege  ( 2011-11-25 14:29:37 -0500 )edit

Question Tools


Asked: 2011-11-25 11:11:50 -0500

Seen: 3,625 times

Last updated: Nov 25 '11