Contents
This page describes the XML format used for roslaunch .launch files. For background on roslaunch, its functionality, and related tools, please consult the roslaunch page first.
substitution args
Roslaunch tag attributes can make use of substitution args, which roslaunch will resolve prior to launching nodes. The currently supported substitution args are:
$(env ENVIRONMENT_VARIABLE)
- substitute the value of an environment variable. The launch will fail if environment variable is not set.
$(optenv ENVIRONMENT_VARIABLE)
$(optenv ENVIRONMENT_VARIABLE default)
substitute the value of an environment variable if it is set. If default is provided, it will be used if environment variable is not set.
$(find pkg)
e.g. $(find rospy)/manifest.xml. Specifies a package-relative path. The filesystem path to the package directory will be substituted inline. Use of package-relative paths is highly encouraged as hardcoded paths inhibit the portability of the launch configuration. Forward and backwards slashes will be resolved to the local filesystem convention.
$(anon name)
e.g. $(anon rviz-1). New in ROS 0.8. Generates an anonymous id based on name. name itself is a unique identifier: multiple uses of $(anon foo) will create the same "anonymized" Name. This is used for <node> name attributes in order to create Nodes with anonymous Names, as ROS requires Nodes to have unique Names. For example:
<node name="$(anon foo)" pkg="rospy_tutorials" type="talker.py" /> <node name="$(anon foo)" pkg="rospy_tutorials" type="talker.py" />
Will generate an error that there are two <node>s with the same name.
Substitution args are currently resolved on the local machine. In otherwords, environment variables and ROS package paths will be set to their values in your current environment.