Ask Your Question
1

Local vs. Global Parameters? In a Launch File?

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

gavinmachine gravatar image

Hello,

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" />
</node>

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

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

Comments

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 2,207 times

Last updated: Nov 25 '11