Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I fear there is no way with the <arg> tag only. Arguments are local to launch files. This has some advantages, I guess (like you know what arguments with what defaults are defined when looking at a launch file), but makes complex launch file structures cumbersome.

One thing you could do is use environment variables with $(env ENVIRONMENT_VARIABLE) or $(optenv ENVIRONMENT_VARIABLE default_value). See here.

Or you evaluate whether it is possible for you to use the parameter server in your nodes instead. There is a convenient syntax for setting those in a launch file:

<rosparam>
 my_parameter_1: 768
 my_parameter_2: 480
</rosparam>

Sadly this is often not an option with foreign nodes and I know of no way to query the parameter server in a launch file.