ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
2

How to declare common parameter

asked 2011-11-11 09:19:36 -0500

130s gravatar image

updated 2011-11-11 09:31:31 -0500

What is recommended ways to set common parameters in ROS?

In some of my nodes, I often want to use the same values for same purpose (e.g. subscribe/publish queue). Right now I'm setting parameters in .launch file. But since parameter comes with node name as prefix (e.g. /nodeNameA/paramNameB), parameters can't be generic enough (is it just because I don't know there's a way to nicely do this?).

Running a node that sets common parameters might be an option but right now I'm not planning to make such a thing, and more interested in better/ideal solutions if any. Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-11-11 09:44:52 -0500

arebgun gravatar image

updated 2011-11-26 04:34:56 -0500

joq gravatar image

You can easily declare parameters outside a <node> tag in a launch file:

<launch>
   <param name="common_param" value="123"/>
   <node name="node1" ... />
   <node name="node2" ... />
</launch>

Since these parameters are not specific to any one node, you may want to resolve them using searchParam() in your code.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-11-11 09:19:36 -0500

Seen: 409 times

Last updated: Nov 26 '11