Skip to content

Commit 1227348

Browse files
Switch to 'let' under 'include' tags for launch frontends (#5923) (#5926)
(cherry picked from commit 51e6598) Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Christophe Bedard <[email protected]>
1 parent 4b12510 commit 1227348

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

source/How-To-Guides/Migrating-from-ROS1/Migrating-Launch-Files.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ include
186186
Nest includes in ``group`` tags to scope them.
187187
* ``ns`` attribute is not supported.
188188
See example of ``push_ros_namespace`` tag for a workaround.
189-
* ``arg`` tags nested in an ``include`` tag don't support conditionals (``if``, ``unless``) or the ``description`` attribute.
189+
* ``arg`` tag nested in an ``include`` tag is now ``let``.
190+
However, ``arg`` is still supported for now.
191+
* ``let`` tags nested in an ``include`` tag don't support conditionals (``if``, ``unless``) or the ``description`` attribute.
190192
* There is no support for nested ``env`` tags.
191193
``set_env`` and ``unset_env`` can be used instead.
192194
* Both ``clear_params`` and ``pass_all_args`` attributes aren't supported.
@@ -206,7 +208,10 @@ arg
206208
* ``value`` attribute is not allowed.
207209
Use ``let`` tag for this.
208210
* ``doc`` is now ``description``.
209-
* When nested within an ``include`` tag, ``if``, ``unless``, and ``description`` attributes aren't allowed.
211+
* When nested within an ``include`` tag:
212+
213+
* Use ``let`` instead of ``arg``.
214+
* ``if``, ``unless``, and ``description`` attributes aren't allowed.
210215

211216
Example
212217
~~~~~~~
@@ -351,6 +356,13 @@ It's a replacement of ``arg`` tag with a value attribute.
351356
352357
<let name="foo" value="asd"/>
353358
359+
``let`` and ``arg`` serve two different purposes in ROS 2:
360+
361+
* ``let`` sets a launch configuration value.
362+
* ``arg`` declares a launch argument/configuration and optionally provides a default value.
363+
The value can separately be set from the CLI or when including the given launch file.
364+
If no value is set, the default value is used if one was provided, otherwise an error is reported.
365+
354366
executable
355367
^^^^^^^^^^
356368

source/Tutorials/Intermediate/Launch/launch/example_main_launch.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<launch>
33
<let name="background_r" value="200" />
44
<include file="$(find-pkg-share launch_tutorial)/launch/example_substitutions_launch.xml">
5-
<arg name="turtlesim_ns" value="turtlesim2" />
6-
<arg name="use_provided_red" value="True" />
7-
<arg name="new_background_r" value="$(var background_r)" />
5+
<let name="turtlesim_ns" value="turtlesim2" />
6+
<let name="use_provided_red" value="True" />
7+
<let name="new_background_r" value="$(var background_r)" />
88
</include>
99
</launch>

source/Tutorials/Intermediate/Launch/launch/example_main_launch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ launch:
66
value: "200"
77
- include:
88
file: "$(find-pkg-share launch_tutorial)/launch/example_substitutions_launch.yaml"
9-
arg:
9+
let:
1010
- name: "turtlesim_ns"
1111
value: "turtlesim2"
1212
- name: "use_provided_red"

0 commit comments

Comments
 (0)