Skip to content

Commit 596755c

Browse files
authored
docs: resolve merge conflicts in launch tutorial (#6091)
Remove conflict markers, keep multi-format references, and fix PushRosNamespace capitalization. Signed-off-by: Luke Sy <[email protected]>
1 parent 7a66bae commit 596755c

File tree

1 file changed

+2
-74
lines changed

1 file changed

+2
-74
lines changed

source/Tutorials/Intermediate/Launch/Using-ROS2-Launch-For-Large-Projects.rst

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ Simulation of multiple turtles in the turtle simulator can serve as a good examp
3939
The turtle simulation consists of multiple turtle nodes, the world configuration, and the TF broadcaster and listener nodes.
4040
Between all of the nodes, there are a large number of ROS parameters that affect the behavior and appearance of these nodes.
4141
ROS 2 launch files allow us to start all nodes and set corresponding parameters in one place.
42-
<<<<<<< HEAD
43-
By the end of a tutorial, you will build the ``launch_turtlesim.launch.py`` launch file in the ``launch_tutorial`` package.
44-
=======
4542
By the end of a tutorial, you will build the ``launch_turtlesim_launch`` launch file in the ``launch_tutorial`` package.
46-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
4743
This launch file will bring up different nodes responsible for the simulation of two turtlesim simulations, starting TF broadcasters and listener, loading parameters, and launching an RViz configuration.
4844
In this tutorial, we'll go over this launch file and all related features used.
4945

@@ -66,11 +62,7 @@ Even a change such as moving from a real robot to a simulated one can be done wi
6662

6763
We will now go over the top-level launch file structure that makes this possible.
6864
Firstly, we will create a launch file that will call separate launch files.
69-
<<<<<<< HEAD
70-
To do this, let's create a ``launch_turtlesim.launch.py`` file in the ``/launch`` folder of our ``launch_tutorial`` package.
71-
=======
7265
To do this, let's create a ``launch_turtlesim_launch`` file in the ``/launch`` folder of our ``launch_tutorial`` package.
73-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
7466

7567
.. attention::
7668

@@ -118,11 +110,7 @@ However, there are cases when some nodes or launch files have to be launched sep
118110
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119111

120112
We will begin by writing a launch file that will start our first turtlesim simulation.
121-
<<<<<<< HEAD
122-
First, create a new file called ``turtlesim_world_1.launch.py``.
123-
=======
124113
First, create a new file called ``turtlesim_world_1_launch``.
125-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
126114

127115
.. tabs::
128116

@@ -153,11 +141,7 @@ This launch file starts the ``turtlesim_node`` node, which starts the turtlesim
153141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154142

155143
In the second launch, we will start a second turtlesim simulation with a different configuration.
156-
<<<<<<< HEAD
157-
Now create a ``turtlesim_world_2.launch.py`` file.
158-
=======
159144
Now create a ``turtlesim_world_2_launch`` file.
160-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
161145

162146
.. tabs::
163147

@@ -208,11 +192,7 @@ These nodes could have different namespaces or names but still have the same par
208192
Defining separate YAML files that explicitly define namespaces and node names is not efficient.
209193
A solution is to use wildcard characters, which act as substitutions for unknown characters in a text value, to apply parameters to several different nodes.
210194

211-
<<<<<<< HEAD
212-
Now let's create a new ``turtlesim_world_3.launch.py`` file similar to ``turtlesim_world_2.launch.py`` to include one more ``turtlesim_node`` node in a new namespace ``turtlesim3``:
213-
=======
214195
Now let's create a new ``turtlesim_world_3_launch`` file similar to ``turtlesim_world_2_launch`` to include one more ``turtlesim_node`` node in a new namespace ``turtlesim3``:
215-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
216196

217197
.. tabs::
218198

@@ -263,21 +243,13 @@ We will now update the ``turtlesim.yaml``, in the ``/config`` folder in the foll
263243
background_g: 86
264244
background_r: 150
265245
266-
<<<<<<< HEAD
267-
Now include the ``turtlesim_world_3.launch.py`` launch description in our main launch file.
268-
=======
269246
Now include the ``turtlesim_world_3_launch`` launch description in our main launch file.
270-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
271247
Using that configuration file in our launch descriptions will assign ``background_b``, ``background_g``, and ``background_r`` parameters to specified values in ``turtlesim3/sim`` and ``turtlesim2/sim`` nodes.
272248

273249
3 Namespaces
274250
^^^^^^^^^^^^
275251

276-
<<<<<<< HEAD
277-
As you may have noticed, we have defined the namespace for the turlesim world in the ``turtlesim_world_2.launch.py`` file.
278-
=======
279252
As you may have noticed, we have defined the namespace for the turlesim world in the ``turtlesim_world_2_launch`` file.
280-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
281253
Unique namespaces allow the system to start two similar nodes without node name or topic name conflicts.
282254

283255
.. code-block:: Python
@@ -290,30 +262,11 @@ Every nested node will inherit that namespace automatically.
290262

291263
.. attention:: ``PushRosNamespace`` has to be the first action in the list for the following actions to apply the namespace.
292264

293-
<<<<<<< HEAD
294-
To do that, firstly, we need to remove the ``namespace='turtlesim2'`` line from the ``turtlesim_world_2.launch.py`` file.
295-
Afterwards, we need to update the ``launch_turtlesim.launch.py`` to change the ``IncludeLaunchDescription(... 'turtlesim_world_2.launch.py' ...)`` value to the following:
296-
=======
297265
To do that, firstly, we need to remove the ``namespace='turtlesim2'`` line from the ``turtlesim_world_2_launch`` file.
298266
Afterwards, we need to update the ``launch_turtlesim_launch`` to change the include statement to the following:
299-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
300267

301268
.. tabs::
302269

303-
<<<<<<< HEAD
304-
from launch.actions import GroupAction
305-
from launch_ros.actions import PushRosNamespace
306-
307-
...
308-
GroupAction(
309-
actions=[
310-
PushRosNamespace('turtlesim2'),
311-
IncludeLaunchDescription(PathJoinSubstitution([launch_dir, 'turtlesim_world_2.launch.py'])),
312-
]
313-
),
314-
315-
As a result, each node in the ``turtlesim_world_2.launch.py`` launch description will have a ``turtlesim2`` namespace.
316-
=======
317270
.. group-tab:: XML
318271

319272
.. code-block:: xml
@@ -338,27 +291,22 @@ As a result, each node in the ``turtlesim_world_2.launch.py`` launch description
338291
.. code-block:: python
339292
340293
from launch.actions import GroupAction
341-
from launch_ros.actions import PushROSNamespace
294+
from launch_ros.actions import PushRosNamespace
342295
343296
...
344297
GroupAction(
345298
actions=[
346-
PushROSNamespace('turtlesim2'),
299+
PushRosNamespace('turtlesim2'),
347300
IncludeLaunchDescription(PathJoinSubstitution([launch_dir, 'turtlesim_world_2_launch.py'])),
348301
]
349302
),
350303
351304
As a result, each node in the ``turtlesim_world_2_launch`` launch description will have a ``turtlesim2`` namespace.
352-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
353305

354306
4 Reusing nodes
355307
^^^^^^^^^^^^^^^
356308

357-
<<<<<<< HEAD
358-
Now create a ``broadcaster_listener.launch.py`` file.
359-
=======
360309
Now create a ``broadcaster_listener_launch`` file.
361-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
362310

363311
.. tabs::
364312

@@ -394,11 +342,7 @@ We also start a ``turtle_tf2_listener`` node and set its ``target_frame`` parame
394342
5 Parameter overrides
395343
^^^^^^^^^^^^^^^^^^^^^
396344

397-
<<<<<<< HEAD
398-
Recall that we called the ``broadcaster_listener.launch.py`` file in our top-level launch file.
399-
=======
400345
Recall that we called the ``broadcaster_listener_launch`` file in our top-level launch file.
401-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
402346
In addition to that, we have passed it ``target_frame`` launch argument as shown below:
403347

404348
.. tabs::
@@ -428,11 +372,7 @@ This will assign ``target_frame`` its default value, which is ``turtle1``.
428372
6 Remapping
429373
^^^^^^^^^^^
430374

431-
<<<<<<< HEAD
432-
Now create a ``mimic.launch.py`` file.
433-
=======
434375
Now create a ``mimic_launch`` file.
435-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
436376

437377
.. tabs::
438378

@@ -466,11 +406,7 @@ This way ``turtle1`` in our ``turtlesim2`` simulation world will follow ``turtle
466406
7 Config files
467407
^^^^^^^^^^^^^^
468408

469-
<<<<<<< HEAD
470-
Let's now create a file called ``turtlesim_rviz.launch.py``.
471-
=======
472409
Let's now create a file called ``turtlesim_rviz_launch``.
473-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
474410

475411
.. tabs::
476412

@@ -501,11 +437,7 @@ This RViz configuration will set the world frame, enable TF visualization, and s
501437
8 Environment Variables
502438
^^^^^^^^^^^^^^^^^^^^^^^
503439

504-
<<<<<<< HEAD
505-
Let's now create the last launch file called ``fixed_broadcaster.launch.py`` in our package.
506-
=======
507440
Let's now create the last launch file called ``fixed_broadcaster_launch`` in our package.
508-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
509441

510442
.. tabs::
511443

@@ -568,9 +500,6 @@ To finally see the result of our code, build the package and launch the top-leve
568500

569501
.. tabs::
570502

571-
<<<<<<< HEAD
572-
$ ros2 launch launch_tutorial launch_turtlesim.launch.py
573-
=======
574503
.. group-tab:: XML
575504

576505
.. code-block:: console
@@ -588,7 +517,6 @@ To finally see the result of our code, build the package and launch the top-leve
588517
.. code-block:: console
589518
590519
$ ros2 launch launch_tutorial launch_turtlesim_launch.py
591-
>>>>>>> 536c723 (Add XML/YAML launch equivalents for large project tutorial (#6021))
592520
593521
You will now see the two turtlesim simulations started.
594522
There are two turtles in the first one and one in the second one.

0 commit comments

Comments
 (0)