Skip to content

Commit 54a3c98

Browse files
Nils-ChristianIsekechristophebedard
authored andcommitted
Add $ to How-To-Guides (#5353)
Signed-off-by: Nils-Christian Iseke <[email protected]> Signed-off-by: Nils-Christian Iseke <[email protected]> Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Christophe Bedard <[email protected]> (cherry picked from commit 867cb80)
1 parent 89117bc commit 54a3c98

15 files changed

+70
-54
lines changed

source/How-To-Guides/Ament-CMake-Documentation.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,11 @@ A recommended best practice when defining environment hooks is to place them wit
645645

646646
Inside your created ``hooks`` folder, create a ``my_package.sh.in`` as follows:
647647

648-
.. code-block:: console
648+
.. code-block:: bash
649649
650-
$ export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
651-
$ export RMW_FASTRTPS_USE_QOS_FROM_XML=1
652-
$ export FASTRTPS_DEFAULT_PROFILES_FILE="$COLCON_CURRENT_PREFIX/my_dds_profile.xml"
650+
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
651+
export RMW_FASTRTPS_USE_QOS_FROM_XML=1
652+
export FASTRTPS_DEFAULT_PROFILES_FILE="$COLCON_CURRENT_PREFIX/my_dds_profile.xml"
653653
654654
In the same folder, create a ``my_package.dsv.in`` file as follows:
655655

source/How-To-Guides/Building-a-Custom-Deb-Package.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Install dependencies
2323

2424
Run the following command to install utilities needed for the build:
2525

26-
.. code:: bash
26+
.. code:: console
2727
2828
$ sudo apt install python3-bloom python3-rosdep fakeroot debhelper dh-python
2929
@@ -32,7 +32,7 @@ Initialize rosdep
3232

3333
Initialize the rosdep database by calling:
3434

35-
.. code:: bash
35+
.. code:: console
3636
3737
$ sudo rosdep init
3838
$ rosdep update
@@ -44,7 +44,7 @@ Build the deb from the package
4444

4545
Run the following commands to build the deb:
4646

47-
.. code:: bash
47+
.. code:: console
4848
4949
$ cd /path/to/pkg_source # this should be the directory that contains the package.xml
5050
$ bloom-generate rosdebian

source/How-To-Guides/Core-maintainer-guide.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ A source release creates a changelog and a tag in the relevant repository.
106106

107107
The process starts by generating or updating CHANGELOG.rst files with the following command:
108108

109-
.. code-block:: bash
109+
.. code-block:: console
110110
111111
$ catkin_generate_changelog
112112
@@ -117,7 +117,7 @@ Once editing is done, it is important to commit the updated CHANGELOG.rst file t
117117

118118
The next step is to bump the version in the package.xml and the changelog files with the following command:
119119

120-
.. code-block:: bash
120+
.. code-block:: console
121121
122122
$ catkin_prepare_release
123123
@@ -136,13 +136,13 @@ The next step is to use the ``bloom-release`` command to create a binary release
136136
For full instructions on how to use bloom, please see http://wiki.ros.org/bloom.
137137
To do a binary release of a repository, run:
138138

139-
.. code-block:: bash
139+
.. code-block:: console
140140
141141
$ bloom-release --track <rosdistro> --rosdistro <rosdistro> <repository_name>
142142
143143
For instance, to release the ``rclcpp`` repository to the {DISTRO_TITLE} distribution, the command would be:
144144

145-
.. code-block:: bash
145+
.. code-block:: console
146146
147147
$ bloom-release --track {DISTRO} --rosdistro {DISTRO} rclcpp
148148

source/How-To-Guides/DDS-tuning.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ Because of the increased serialization overhead, severe performance degradation
7171
**Workaround:** Use multiple arrays of primitives instead of a single array of custom types, or pack into byte array as done e.g. in ``PointCloud2`` messages.
7272
For example, instead of defining a ``FooArray`` message as:
7373

74-
.. code-block:: console
74+
.. code-block:: bash
7575
7676
Foo[] my_large_array
7777
7878
with ``Foo`` is defined as:
7979

80-
.. code-block:: console
80+
.. code-block:: bash
8181
8282
uint64 foo_1
8383
uint32 foo_2
8484
8585
Instead, define ``FooArray`` as:
8686

87-
.. code-block:: console
87+
.. code-block:: bash
8888
8989
uint64[] foo_1_array
9090
uint32[] foo_2_array
@@ -116,7 +116,7 @@ Set the maximum receive buffer size, ``rmem_max``, by running:
116116
117117
Or permanently set it by editing the ``/etc/sysctl.d/10-cyclone-max.conf`` file to contain:
118118

119-
.. code-block:: console
119+
.. code-block:: bash
120120
121121
net.core.rmem_max=2147483647
122122
@@ -136,7 +136,7 @@ Next, to set the minimum socket receive buffer size that Cyclone requests, write
136136
137137
Then, whenever you are going to run a node, set the following environment variable:
138138

139-
.. code-block:: console
139+
.. code-block:: bash
140140
141141
CYCLONEDDS_URI=file:///absolute/path/to/config_file.xml
142142

source/How-To-Guides/Getting-Backtraces-in-ROS-2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Once your program crashes, it will return a gdb session prompt denoted by ``(gdb
113113
At this prompt you can access the information you're interested in.
114114
However, since this is a ROS project with lots of node configurations and other things going on, this isn't a great option for beginners or those that don't like tons of commandline work and understanding the filesystem.
115115

116-
.. code-block:: bash
116+
.. code-block:: console
117117
118118
$ gdb ex run --args /path/to/exe/program
119119
@@ -143,7 +143,7 @@ This is because GDB, when launched this way, lacks the environment setup that no
143143
Rather than having to revert to finding the install path of the executable and typing it all out, we can instead use ``--prefix``.
144144
This allows us to use the same ``ros2 run`` syntax you're used to without having to worry about some of the GDB details.
145145

146-
.. code-block:: bash
146+
.. code-block:: console
147147
148148
$ ros2 run --prefix 'gdb -ex run --args' <pkg> <node> --all-other-launch arguments
149149

source/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Package-Example.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This package is in a catkin workspace, located at ``~/ros1_talker``.
2020

2121
Your ROS 1 workspace has the following directory layout:
2222

23-
.. code-block:: bash
23+
.. code-block:: console
2424
2525
$ cd ~/ros1_talker
2626
$ find .
@@ -104,7 +104,7 @@ Let's start by creating a new workspace in which to work:
104104
105105
We'll copy the source tree from our ROS 1 package into that workspace, where we can modify it:
106106

107-
.. code-block:: bash
107+
.. code-block:: console
108108
109109
$ mkdir src
110110
$ cp -a ~/ros1_talker/src/talker src

source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ First, create a folder at ``~/ros2_talker_py`` to be the root of the Colcon work
3434
3535
.. group-tab:: macOS
3636

37-
.. code-block:: bash
37+
.. code-block:: console
3838
3939
$ mkdir -p ~/ros2_talker_py/src
4040
4141
.. group-tab:: Windows
4242

43-
.. code-block:: bash
43+
.. code-block:: console
4444
4545
$ md \ros2_talker_py\src
4646
@@ -76,7 +76,7 @@ Next, create the files for the ROS 1 package.
7676
7777
.. group-tab:: Windows
7878

79-
.. code-block:: bash
79+
.. code-block:: console
8080
8181
$ cd \ros2_talker_py
8282
$ md src\talker_py\src\talker_py

source/How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To change a node name use ``__node`` (the ROS 1 equivalent is ``__name``):
3939
Note the use of the ``-r`` flag.
4040
The same remap flag is needed for changing the namespace ``__ns``:
4141

42-
.. code-block:: bash
42+
.. code-block:: console
4343
4444
$ ros2 run some_package some_ros_executable --ros-args -r __ns:=/new/namespace
4545

source/How-To-Guides/ROS-2-IDEs.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ Resolve this by:
204204

205205
* Making sure the ``PATH`` override in the run/debug configuration includes both the ROS 2 install and your workspace, e.g.:
206206

207-
.. code-block:: bash
207+
.. code-block:: console
208208
209-
C:\dev\ros2_humble\local_setup.ps1
210-
C:\dev_ws\install\local_setup.ps1
211-
echo $ENV:Path
209+
$ C:\dev\ros2_humble\local_setup.ps1
210+
$ C:\dev_ws\install\local_setup.ps1
211+
$ echo $ENV:Path
212212
213213
* Adding the relevant folders from the ``install/`` directory to your project sources.
214214

source/How-To-Guides/Releasing/First-Time-Release.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Generate Changelog
4343

4444
Generate a ``CHANGELOG.rst`` file per package in your repo using the following command:
4545

46-
.. code-block:: bash
46+
.. code-block:: console
4747
48-
catkin_generate_changelog --all
48+
$ catkin_generate_changelog --all
4949
5050
.. include:: _Clean-Up-Changelog.rst
5151

@@ -59,9 +59,9 @@ Bloom Release
5959

6060
Run the following command, replacing ``my_repo`` with the name of your repository:
6161

62-
.. code-block:: bash
62+
.. code-block:: console
6363
64-
bloom-release --new-track --rosdistro {DISTRO} --track {DISTRO} my_repo
64+
$ bloom-release --new-track --rosdistro {DISTRO} --track {DISTRO} my_repo
6565
6666
.. tip::
6767

source/How-To-Guides/Releasing/Subsequent-Releases.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Bloom Release
4848

4949
Run the following command, replacing ``my_repo`` with the name of your repository with the packages:
5050

51-
.. code-block:: bash
51+
.. code-block:: console
5252
5353
$ bloom-release --rosdistro {DISTRO} my_repo
5454

source/How-To-Guides/Releasing/_Bump-Package-Version.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Every release of the package must have a unique version number higher than the previous release.
22
Run:
33

4-
.. code-block:: bash
4+
.. code-block:: console
55
6-
catkin_prepare_release
6+
$ catkin_prepare_release
77
88
which performs the following:
99

source/How-To-Guides/Releasing/_Install-Dependencies.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ Install tools that you will use in the upcoming steps according to your platform
1010
1111
.. group-tab:: RPM (e.g. RHEL)
1212

13-
.. code-block:: bash
13+
.. code-block:: console
1414
1515
$ sudo dnf install python3-bloom python3-catkin_pkg
1616
1717
.. group-tab:: Other
1818

19-
.. code-block:: bash
19+
.. code-block:: console
2020
2121
$ pip3 install -U bloom catkin_pkg
2222
2323
Make sure you have rosdep initialized:
2424

25-
.. code-block:: bash
25+
.. code-block:: console
2626
2727
$ sudo rosdep init
2828
$ rosdep update

source/How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Now you can check if the installation was successful by running the following co
3535

3636
.. code-block:: console
3737
38-
docker run hello-world
38+
$ docker run hello-world
3939
4040
You might need to start the Docker Daemon first, if you cannot run hello-world out of the box:
4141

source/How-To-Guides/Working-with-multiple-RMW-implementations.rst

+31-15
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,48 @@ For example, to run the talker demo using the C++ talker and Python listener wit
3636

3737
.. group-tab:: Linux
3838

39-
.. code-block:: bash
4039

41-
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
40+
Run in one terminal:
4241

43-
# Run in another terminal
44-
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
42+
.. code-block:: console
43+
44+
$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
45+
46+
Run in another terminal:
47+
48+
.. code-block:: console
49+
50+
$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
4551
4652
.. group-tab:: macOS
4753

48-
.. code-block:: bash
54+
Run in one terminal:
55+
56+
.. code-block:: console
57+
58+
$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
4959
50-
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_cpp talker
60+
Run in another terminal:
5161

52-
# Run in another terminal
53-
RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
62+
.. code-block:: console
63+
64+
$ RMW_IMPLEMENTATION=rmw_connextdds ros2 run demo_nodes_py listener
5465
5566
.. group-tab:: Windows
5667

57-
.. code-block:: bat
68+
Run in one terminal:
69+
70+
.. code-block:: console
71+
72+
$ set RMW_IMPLEMENTATION=rmw_connextdds
73+
$ ros2 run demo_nodes_cpp talker
5874
59-
set RMW_IMPLEMENTATION=rmw_connextdds
60-
ros2 run demo_nodes_cpp talker
75+
Run in another terminal:
6176

62-
REM run in another terminal
63-
set RMW_IMPLEMENTATION=rmw_connextdds
64-
ros2 run demo_nodes_py listener
77+
.. code-block:: console
78+
79+
$ set RMW_IMPLEMENTATION=rmw_connextdds
80+
$ ros2 run demo_nodes_py listener
6581
6682
Adding RMW implementations to your workspace
6783
--------------------------------------------
@@ -164,7 +180,7 @@ To increase the settings permanently, you will need to edit or create the file `
164180
Creating or editing this file will require root permissions.
165181
Either add to your existing ``etc/sysctl.conf`` file or create ``/etc/sysctl.conf`` with the following lines:
166182

167-
.. code-block:: console
183+
.. code-block:: bash
168184
169185
kern.sysv.shmmax=419430400
170186
kern.sysv.shmmin=1

0 commit comments

Comments
 (0)