Skip to content

Commit 2b91744

Browse files
Add $ to Creating-Your-First-ROS2-Package (#5286)
1 parent 13ca897 commit 2b91744

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

source/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,19 @@ Make sure you are in the ``src`` folder before running the package creation comm
139139

140140
.. code-block:: console
141141
142-
cd ~/ros2_ws/src
142+
$ cd ~/ros2_ws/src
143143
144144
.. group-tab:: macOS
145145

146146
.. code-block:: console
147147
148-
cd ~/ros2_ws/src
148+
$ cd ~/ros2_ws/src
149149
150150
.. group-tab:: Windows
151151

152152
.. code-block:: console
153153
154-
cd \ros2_ws\src
154+
$ cd \ros2_ws\src
155155
156156
The command syntax for creating a new package in ROS 2 is:
157157

@@ -161,13 +161,13 @@ The command syntax for creating a new package in ROS 2 is:
161161

162162
.. code-block:: console
163163
164-
ros2 pkg create --build-type ament_cmake --license Apache-2.0 <package_name>
164+
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 <package_name>
165165
166166
.. group-tab:: Python
167167

168168
.. code-block:: console
169169
170-
ros2 pkg create --build-type ament_python --license Apache-2.0 <package_name>
170+
$ ros2 pkg create --build-type ament_python --license Apache-2.0 <package_name>
171171
172172
For this tutorial, you will use the optional arguments ``--node-name`` and ``--license``.
173173
``--node-name`` option creates a simple Hello World type executable in the package, and ``--license`` declares the license information for the package.
@@ -180,13 +180,13 @@ Enter the following command in your terminal:
180180

181181
.. code-block:: console
182182
183-
ros2 pkg create --build-type ament_cmake --license Apache-2.0 --node-name my_node my_package
183+
$ ros2 pkg create --build-type ament_cmake --license Apache-2.0 --node-name my_node my_package
184184
185185
.. group-tab:: Python
186186

187187
.. code-block:: console
188188
189-
ros2 pkg create --build-type ament_python --license Apache-2.0 --node-name my_node my_package
189+
$ ros2 pkg create --build-type ament_python --license Apache-2.0 --node-name my_node my_package
190190
191191
You will now have a new folder within your workspace's ``src`` directory called ``my_package``.
192192

@@ -263,19 +263,19 @@ Return to the root of your workspace:
263263

264264
.. code-block:: console
265265
266-
cd ~/ros2_ws
266+
$ cd ~/ros2_ws
267267
268268
.. group-tab:: macOS
269269

270270
.. code-block:: console
271271
272-
cd ~/ros2_ws
272+
$ cd ~/ros2_ws
273273
274274
.. group-tab:: Windows
275275

276276
.. code-block:: console
277277
278-
cd \ros2_ws
278+
$ cd \ros2_ws
279279
280280
Now you can build your packages:
281281

@@ -285,19 +285,19 @@ Now you can build your packages:
285285

286286
.. code-block:: console
287287
288-
colcon build
288+
$ colcon build
289289
290290
.. group-tab:: macOS
291291

292292
.. code-block:: console
293293
294-
colcon build
294+
$ colcon build
295295
296296
.. group-tab:: Windows
297297

298298
.. code-block:: console
299299
300-
colcon build --merge-install
300+
$ colcon build --merge-install
301301
302302
Windows doesn't allow long paths, so ``merge-install`` will combine all the paths into the ``install`` directory.
303303

@@ -309,7 +309,7 @@ To build only the ``my_package`` package next time, you can run:
309309

310310
.. code-block:: console
311311
312-
colcon build --packages-select my_package
312+
$ colcon build --packages-select my_package
313313
314314
3 Source the setup file
315315
^^^^^^^^^^^^^^^^^^^^^^^
@@ -324,19 +324,19 @@ Then, from inside the ``ros2_ws`` directory, run the following command to source
324324

325325
.. code-block:: console
326326
327-
source install/local_setup.bash
327+
$ source install/local_setup.bash
328328
329329
.. group-tab:: macOS
330330

331331
.. code-block:: console
332332
333-
. install/local_setup.bash
333+
$ . install/local_setup.bash
334334
335335
.. group-tab:: Windows
336336

337337
.. code-block:: console
338338
339-
call install/local_setup.bat
339+
$ call install/local_setup.bat
340340
341341
Now that your workspace has been added to your path, you will be able to use your new package's executables.
342342

@@ -347,7 +347,7 @@ To run the executable you created using the ``--node-name`` argument during pack
347347

348348
.. code-block:: console
349349
350-
ros2 run my_package my_node
350+
$ ros2 run my_package my_node
351351
352352
Which will return a message to your terminal:
353353

0 commit comments

Comments
 (0)