Launch File Overview---1

Source: Internet
Author: User

Abstract: Original Blog: Reproduced please indicate the source: http://www.cnblogs.com/zxouxuewei/

Resources Link:http://wenku.baidu.com/link?url= Phyn3c6ghqovj0qtg8dntepeku6wfdnb2doemqfervlx8hb4mksbuulinllvjwwtsgdrtciza2jcfhcjdgu0rrtfsq2mutirr5gkutfytmi

PDFto world: http://www.convertpdftoword.net/

1. Calculation Order
Roslaunch a single pass with an XML file. Include is processed in the order of depth-first traversal. Tag tag is serially processed and the final setting is valid. Therefore, if a parameter is set more than once, the last value specified will be used.
It is undesirable to rely on overrides for overridden behavior. Because no one can guarantee that the rewrite is correct (for example, the parameter name in the include file has changed). Instead, it is recommended to use the $ (ARG)/<arg> setting to override the behavior.
2. Substitution parameters (Substitutionargs: permutation)
The Roslaunchtag property can use a permutation character, which is resolved before the node is started. The currently supported replacement parameters are as follows:

$ (env nvironment_variable)

Overrides the value of the current environment variable. If the environment variable is not set, startup will fail. The value cannot be overridden by the <env> tag.

2

If set, overrides an environment variable value. If the default value of Default_value is provided, the default value is used when the environment variable is not set. If there is no default value, an empty string is used. Default_value can be multiple words separated by a space. Example:

 <paramname= foo   " Value="  $ (optenv Num_cpus 1)  Span style= "color: #800000;" > "/><paramname="  foo  Span style= "color: #800000;" > " Value="  $ (Optenv config_path/home/ Wsh/ros_workspace)  /> 
<paramname= " foo " value=" $ (optenv VARIABLE Ros Rocks) "/>3 ). $ (findpkg)
3 ). $ (Find pkg)

$ (Findrospy)/manifest.xml. Specifies the relative path of the package. The path to the file system to the package directory will be replaced inline. Because hardware encoding suppresses the portability of boot configurations, we encourage the use of package-relative paths. The pre-and post-reduction issues of the local file system convention were addressed

4). $ (anon name)

$ (anonrviz-1) produces a name-based anonymous ID. The name itself is a unique identifier: a different $ (anonfoo) usage will create the same "anonymous" name. Used primarily in the node name attribute to create an anonymous node. Ros requires each node to have a unique name.

For example:

<nodename="$ (anonfoo)pkg="rospy_tutorialstype="  talker.py"/>
<nodename="$ (anonfoo)pkg="rospy_tutorials Type="talker.py"/>

If two nodes have the same name, an error will occur.

5). $ (Argfoo)

$ (Argfoo) calculates the value specified by the <arg> tag. There must be a corresponding <arg> tag in the same startup file that declares Arg. For example:

<paramname="foovalue="$ (argmy_foo)"/>

The My_foo to foo parameter is specified. Another example:

 <nodename= add_two_ints_server   pkg="   Beginner_tutorials   type="  Span style= "color: #800000;" >add_two_ints_server  /><nodename=  " add_two_ints_client   " pkg="   Beginner_tutorials   type="  Span style= "color: #800000;" >add_two_ints_client   args="  Span style= "color: #800000;" >$ (Arga) $ (ARGB)   "/> 

The server and client will be started from the <add_two_ints> example as parameter value A and pass. The resulting startup project can be invoked with the following statement:

Roslaunch beginner_tutorials launch_file.launch a:=1 b:=5

The replacement parameters are now resolved on the local machine. In other words, the environment variables and the path of the ROS package can be set in the current environment, or even a remote startup process.

3. If and unless properties
All tag tags support the IF and unless properties (based on calculated values including or excluding a tag). "1" and "true" are values. "0" and "false" false values. The other values are wrong.

if =value (optional) If the value is true, include the label and the content.
Unless=value (optional) contains tags and content unless value is true.

Example:

<groupif="$ (argfoo)"><!--stuff that'll only be evaluated if Foo is true-->< /group><paramname="foo"value="bar"unless="  $ (argfoo)"/>

4. Related tags

<launch>
<node><machine>
<include><remap><env><param><rosparam><group>
<test><arg>

5. Example. launchxml configuration file
Note: By convention, the Roslaunchxml file has the. launch extension,
such as Example.launch.
5.1 Smallest example (minimalexample)
The following example is a minimal startup configuration script. It launches a node ' talker ', bit "rospy_tutorials" in the package. This node is started on the local machine using the currently configured ROS environment (such as Ros_root).

<launch><nodename= "talker" pkg="rospy_tutorials " Type="talker"/></launch>


5.2 A slightly more complex example



Launch File Overview---1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.