Skip to content

Commit 76ae27b

Browse files
Merge remote-tracking branch 'upstream/rolling' into patch-4
2 parents 0f50acb + 292e42c commit 76ae27b

21 files changed

+422
-410
lines changed

source/Releases/Release-Kilted-Kaiju.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ Try replacing the ``ament_target_dependencies()`` call with the ``target_link_l
6464

6565
For more information see `ament/ament_cmake#572 <https://github.com/ament/ament_cmake/pull/572>`__ and `ament/ament_cmake#292 <https://github.com/ament/ament_cmake/issues/292>`__.
6666

67+
``launch``
68+
^^^^^^^^^^
69+
70+
``PathJoinSubstitution``
71+
""""""""""""""""""""""""
72+
73+
``PathJoinSubstitution`` now supports concatenating strings or substitutions into a single path component.
74+
For example:
75+
76+
.. code-block:: python
77+
78+
PathJoinSubstitution(['robot_description', 'urdf', [LaunchConfiguration('model'), '.xacro']])
79+
80+
If the ``model`` launch configuration was set to ``my_model``, this would result in a path equal to:
81+
82+
.. code-block:: python
83+
84+
'robot_description/urdf/my_model.xacro'
85+
86+
For more information, see `ros2/launch#835 <https://github.com/ros2/launch/issues/835>`__ and `ros2/launch#838 <https://github.com/ros2/launch/pull/838>`__.
87+
6788
Development progress
6889
--------------------
6990

source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,20 @@ We chose the following more precise rule where PEP 8 leaves some freedom:
338338
* `We allow up to 100 characters per line (fifth paragraph) <https://www.python.org/dev/peps/pep-0008/#maximum-line-length>`_.
339339
* `We pick single quotes over double quotes as long as no escaping is necessary <https://www.python.org/dev/peps/pep-0008/#string-quotes>`_.
340340
* `We prefer hanging indents for continuation lines <https://www.python.org/dev/peps/pep-0008/#indentation>`_.
341+
* `We prefer splitting having only one import per line <https://peps.python.org/pep-0008/#imports>`_:
342+
343+
.. code-block:: python
344+
345+
# This is preferred
346+
from typing import Dict
347+
from typing import List
348+
349+
# over these
350+
from typing import Dict, List
351+
from typing import (
352+
Dict,
353+
List,
354+
)
341355
342356
Tools like the ``(ament_)pycodestyle`` Python package should be used in unit-test and/or editor integration for checking Python code style.
343357

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Services/Understanding-ROS2-Services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Enter the command:
237237

238238
.. code-block:: console
239239
240-
$ ros2 service call /spawn turtlesim_msgs/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"64gg
240+
$ ros2 service call /spawn turtlesim_msgs/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
241241
requester: making request: turtlesim.srv.Spawn_Request(x=2.0, y=2.0, theta=0.2, name='')
242242
243243
response:

source/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.rst

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ Install colcon
3939

4040
.. group-tab:: Linux
4141

42-
.. code-block:: bash
42+
.. code-block:: console
4343
44-
sudo apt install python3-colcon-common-extensions
44+
$ sudo apt install python3-colcon-common-extensions
4545
4646
.. group-tab:: macOS
4747

48-
.. code-block:: bash
48+
.. code-block:: console
4949
50-
python3 -m pip install colcon-common-extensions
50+
$ python3 -m pip install colcon-common-extensions
5151
5252
.. group-tab:: Windows
5353

54-
.. code-block:: bash
54+
.. code-block:: console
5555
56-
pip install -U colcon-common-extensions
56+
$ pip install -U colcon-common-extensions
5757
5858
5959
Install ROS 2
@@ -73,7 +73,7 @@ Commonly there is a ``src`` subdirectory.
7373
Inside that subdirectory is where the source code of ROS packages will be located.
7474
Typically the directory starts otherwise empty.
7575

76-
colcon does out of source builds.
76+
colcon performs out-of-source builds.
7777
By default it will create the following directories as peers of the ``src`` directory:
7878

7979
* The ``build`` directory will be where intermediate files are stored.
@@ -93,24 +93,24 @@ First, create a directory (``ros2_ws``) to contain our workspace:
9393

9494
.. group-tab:: Linux
9595

96-
.. code-block:: bash
96+
.. code-block:: console
9797
98-
mkdir -p ~/ros2_ws/src
99-
cd ~/ros2_ws
98+
$ mkdir -p ~/ros2_ws/src
99+
$ cd ~/ros2_ws
100100
101101
.. group-tab:: macOS
102102

103-
.. code-block:: bash
103+
.. code-block:: console
104104
105-
mkdir -p ~/ros2_ws/src
106-
cd ~/ros2_ws
105+
$ mkdir -p ~/ros2_ws/src
106+
$ cd ~/ros2_ws
107107
108108
.. group-tab:: Windows
109109

110-
.. code-block:: bash
110+
.. code-block:: console
111111
112-
md \dev\ros2_ws\src
113-
cd \dev\ros2_ws
112+
$ md \dev\ros2_ws\src
113+
$ cd \dev\ros2_ws
114114
115115
At this point the workspace contains a single empty directory ``src``:
116116

@@ -126,9 +126,9 @@ Add some sources
126126

127127
Let's clone the `examples <https://github.com/ros2/examples>`__ repository into the ``src`` directory of the workspace:
128128

129-
.. code-block:: bash
129+
.. code-block:: console
130130
131-
git clone https://github.com/ros2/examples src/examples -b {REPOS_FILE_BRANCH}
131+
$ git clone https://github.com/ros2/examples src/examples -b {REPOS_FILE_BRANCH}
132132
133133
Now the workspace should have the source code to the ROS 2 examples:
134134

@@ -172,19 +172,19 @@ This allows the installed files to be changed by changing the files in the ``sou
172172

173173
.. code-block:: console
174174
175-
colcon build --symlink-install
175+
$ colcon build --symlink-install
176176
177177
.. group-tab:: macOS
178178

179179
.. code-block:: console
180180
181-
colcon build --symlink-install
181+
$ colcon build --symlink-install
182182
183183
.. group-tab:: Windows
184184

185185
.. code-block:: console
186186
187-
colcon build --symlink-install --merge-install
187+
$ colcon build --symlink-install --merge-install
188188
189189
Windows doesn't allow long paths, so ``merge-install`` will combine all the paths into the ``install`` directory.
190190

@@ -213,21 +213,21 @@ To run tests for the packages we just built, run the following:
213213

214214
.. code-block:: console
215215
216-
colcon test
216+
$ colcon test
217217
218218
.. group-tab:: macOS
219219

220220
.. code-block:: console
221221
222-
colcon test
222+
$ colcon test
223223
224224
.. group-tab:: Windows
225225

226226
Remember to use a ``x64 Native Tools Command Prompt for VS 2019`` for executing the following command, as we are going to build a workspace.
227227

228228
.. code-block:: console
229229
230-
colcon test --merge-install
230+
$ colcon test --merge-install
231231
232232
You also need to specify ``--merge-install`` here since we used it for building above.
233233

@@ -245,43 +245,43 @@ These files will add all of the required elements to your path and library paths
245245

246246
.. group-tab:: Linux
247247

248-
.. code-block:: bash
248+
.. code-block:: console
249249
250-
source install/setup.bash
250+
$ source install/setup.bash
251251
252252
.. group-tab:: macOS
253253

254-
.. code-block:: bash
254+
.. code-block:: console
255255
256-
. install/setup.bash
256+
$ . install/setup.bash
257257
258258
.. group-tab:: Windows
259259

260-
.. code-block:: bash
260+
.. code-block:: console
261261
262-
call install\setup.bat
262+
$ call install\setup.bat
263263
264264
Or with Powershell:
265265

266-
.. code-block:: bash
266+
.. code-block:: console
267267
268-
install\setup.ps1
268+
$ install\setup.ps1
269269
270270
Try a demo
271271
^^^^^^^^^^
272272

273273
With the environment sourced, we can run executables built by colcon.
274274
Let's run a subscriber node from the examples:
275275

276-
.. code-block:: bash
276+
.. code-block:: console
277277
278-
ros2 run examples_rclcpp_minimal_subscriber subscriber_member_function
278+
$ ros2 run examples_rclcpp_minimal_subscriber subscriber_member_function
279279
280280
In another terminal, let's run a publisher node (don't forget to source the setup script):
281281

282-
.. code-block:: bash
282+
.. code-block:: console
283283
284-
ros2 run examples_rclcpp_minimal_publisher publisher_member_function
284+
$ ros2 run examples_rclcpp_minimal_publisher publisher_member_function
285285
286286
You should see messages from the publisher and subscriber with numbers incrementing.
287287

@@ -307,22 +307,23 @@ Setup ``colcon_cd``
307307

308308
The command ``colcon_cd`` allows you to quickly change the current working directory of your shell to the directory of a package.
309309
As an example ``colcon_cd some_ros_package`` would quickly bring you to the directory ``~/ros2_ws/src/some_ros_package``.
310+
To set up ``colcon_cd`` you need to run the following commands to modify your shell startup script:
310311

311312
.. tabs::
312313

313314
.. group-tab:: Linux
314315

315316
.. code-block:: console
316317
317-
echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
318-
echo "export _colcon_cd_root=/opt/ros/{DISTRO}/" >> ~/.bashrc
318+
$ echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
319+
$ echo "export _colcon_cd_root=/opt/ros/{DISTRO}/" >> ~/.bashrc
319320
320321
.. group-tab:: macOS
321322

322323
.. code-block:: console
323324
324-
echo "source /usr/local/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
325-
echo "export _colcon_cd_root=~/ros2_install" >> ~/.bashrc
325+
$ echo "source /usr/local/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
326+
$ echo "export _colcon_cd_root=~/ros2_install" >> ~/.bashrc
326327
327328
.. group-tab:: Windows
328329

@@ -346,9 +347,9 @@ Tips
346347

347348
* If you want to run a single particular test from a package:
348349

349-
.. code-block:: bash
350+
.. code-block:: console
350351
351-
colcon test --packages-select YOUR_PKG_NAME --ctest-args -R YOUR_TEST_IN_PKG
352+
$ colcon test --packages-select YOUR_PKG_NAME --ctest-args -R YOUR_TEST_IN_PKG
352353
353354
Setup ``colcon`` mixins
354355
-----------------------
@@ -359,21 +360,21 @@ For example, to change the CMake build type to debug, you normally use:
359360

360361
.. code-block:: console
361362
362-
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug
363+
$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug
363364
364365
To make common command line options easier to invoke this repository makes these "shortcuts" available.
365366

366367
To install the default colcon mixins, run the following:
367368

368369
.. code-block:: console
369370
370-
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
371-
colcon mixin update default
371+
$ colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
372+
$ colcon mixin update default
372373
373374
Then, try out using the ``debug`` mixin:
374375

375376
.. code-block:: console
376377
377-
colcon build --mixin debug
378+
$ colcon build --mixin debug
378379
379380
For more details, see the `colcon mixin repository <https://github.com/colcon/colcon-mixin-repository>`__.

0 commit comments

Comments
 (0)