Skip to content

Commit e44361d

Browse files
mergify[bot]Nils-ChristianIsekechristophebedard
authored
Add $ to Installation/Alternatives (backport #5354) (#5385)
Signed-off-by: Nils-Christian Iseke <[email protected]> Signed-off-by: Nils-Christian Iseke <[email protected]> Co-authored-by: Christophe Bedard <[email protected]> (cherry picked from commit 2901e65) Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Nils-Christian Iseke <[email protected]> Co-authored-by: Christophe Bedard <[email protected]>
1 parent 7dcb2ed commit e44361d

6 files changed

+204
-187
lines changed

source/Installation/Alternatives/RHEL-Development-Setup.rst

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ Enable required repositories
3838
The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default.
3939
They can be enabled by running:
4040

41-
.. code-block:: bash
41+
.. code-block:: console
4242
43-
sudo dnf install 'dnf-command(config-manager)' epel-release -y
44-
sudo dnf config-manager --set-enabled crb
43+
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
44+
$ sudo dnf config-manager --set-enabled crb
4545
4646
.. note:: This step may be slightly different depending on the distribution you are using.
4747
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
@@ -54,9 +54,9 @@ Enable required repositories
5454
Install development tools
5555
^^^^^^^^^^^^^^^^^^^^^^^^^
5656

57-
.. code-block:: bash
57+
.. code-block:: console
5858
59-
sudo dnf install -y \
59+
$ sudo dnf install -y \
6060
cmake \
6161
gcc-c++ \
6262
git \
@@ -77,9 +77,9 @@ Install development tools
7777
python3-vcstool \
7878
wget
7979
80-
# install some pip packages needed for testing and
81-
# not available as RPMs
82-
python3 -m pip install -U --user \
80+
~ install some pip packages needed for testing and
81+
~ not available as RPMs
82+
$ python3 -m pip install -U --user \
8383
flake8-blind-except==0.1.1 \
8484
flake8-class-newline \
8585
flake8-deprecated
@@ -92,22 +92,22 @@ Get ROS 2 code
9292

9393
Create a workspace and clone all repos:
9494

95-
.. code-block:: bash
95+
.. code-block:: console
9696
97-
mkdir -p ~/ros2_{DISTRO}/src
98-
cd ~/ros2_{DISTRO}
99-
vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src
97+
$ mkdir -p ~/ros2_{DISTRO}/src
98+
$ cd ~/ros2_{DISTRO}
99+
$ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src
100100
101101
Install dependencies using rosdep
102102
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103

104104
.. include:: ../_Dnf-Update-Admonition.rst
105105

106-
.. code-block:: bash
106+
.. code-block:: console
107107
108-
sudo rosdep init
109-
rosdep update
110-
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"
108+
$ sudo rosdep init
109+
$ rosdep update
110+
$ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"
111111
112112
Install additional RMW implementations (optional)
113113
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -125,47 +125,50 @@ The output should be empty.
125125

126126
More info on working with a ROS workspace can be found in :doc:`this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial>`.
127127

128-
.. code-block:: bash
128+
.. code-block:: console
129129
130-
cd ~/ros2_{DISTRO}/
131-
colcon build --symlink-install
130+
$ cd ~/ros2_{DISTRO}/
131+
$ colcon build --symlink-install
132132
133133
.. note::
134134

135135
If you are having trouble compiling all examples and this is preventing you from completing a successful build, you can use the ``--packages-skip`` colcon flag to ignore the package that is causing problems.
136136
For instance, if you don't want to install the large OpenCV library, you could skip building the packages that depend on it using the command:
137137

138-
.. code-block:: bash
138+
.. code-block:: console
139139
140-
colcon build --symlink-install --packages-skip image_tools intra_process_demo
140+
$ colcon build --symlink-install --packages-skip image_tools intra_process_demo
141141
142142
Setup environment
143143
-----------------
144144

145145
Set up your environment by sourcing the following file.
146146

147-
.. code-block:: bash
147+
.. code-block:: console
148148
149-
# Replace ".bash" with your shell if you're not using bash
150-
# Possible values are: setup.bash, setup.sh, setup.zsh
151-
. ~/ros2_{DISTRO}/install/local_setup.bash
149+
$ . ~/ros2_{DISTRO}/install/local_setup.bash
150+
151+
.. note::
152+
153+
Replace ``.bash`` with your shell if you're not using bash.
154+
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.
152155

153156
Try some examples
154157
-----------------
155158

156159
In one terminal, source the setup file and then run a C++ ``talker``\ :
157160

158-
.. code-block:: bash
161+
.. code-block:: console
159162
160-
. ~/ros2_{DISTRO}/install/local_setup.bash
161-
ros2 run demo_nodes_cpp talker
163+
$ . ~/ros2_{DISTRO}/install/local_setup.bash
164+
$ ros2 run demo_nodes_cpp talker
162165
163166
In another terminal source the setup file and then run a Python ``listener``\ :
164167

165-
.. code-block:: bash
168+
.. code-block:: console
166169
167-
. ~/ros2_{DISTRO}/install/local_setup.bash
168-
ros2 run demo_nodes_py listener
170+
$ . ~/ros2_{DISTRO}/install/local_setup.bash
171+
$ ros2 run demo_nodes_py listener
169172
170173
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
171174
This verifies both the C++ and Python APIs are working properly.
@@ -187,12 +190,12 @@ Clang
187190

188191
To configure CMake to detect and use Clang:
189192

190-
.. code-block:: bash
193+
.. code-block:: console
191194
192-
sudo dnf install clang
193-
export CC=clang
194-
export CXX=clang++
195-
colcon build --cmake-force-configure
195+
$ sudo dnf install clang
196+
$ export CC=clang
197+
$ export CXX=clang++
198+
$ colcon build --cmake-force-configure
196199
197200
Stay up to date
198201
---------------
@@ -212,6 +215,6 @@ Uninstall
212215

213216
2. If you're also trying to free up space, you can delete the entire workspace directory with:
214217

215-
.. code-block:: bash
218+
.. code-block:: console
216219
217-
rm -rf ~/ros2_{DISTRO}
220+
$ rm -rf ~/ros2_{DISTRO}

source/Installation/Alternatives/RHEL-Install-Binary.rst

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Enable required repositories
3434
The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default.
3535
They can be enabled by running:
3636

37-
.. code-block:: bash
37+
.. code-block:: console
3838
39-
sudo dnf install 'dnf-command(config-manager)' epel-release -y
40-
sudo dnf config-manager --set-enabled crb
39+
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
40+
$ sudo dnf config-manager --set-enabled crb
4141
4242
.. note:: This step may be slightly different depending on the distribution you are using.
4343
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
@@ -47,18 +47,18 @@ Install prerequisites
4747

4848
There are a few packages that must be installed in order to get and unpack the binary release.
4949

50-
.. code-block:: bash
50+
.. code-block:: console
5151
52-
sudo dnf install tar bzip2 wget -y
52+
$ sudo dnf install tar bzip2 wget -y
5353
5454
Install development tools (optional)
5555
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656

5757
If you are going to build ROS packages or otherwise do development, you can also install the development tools:
5858

59-
.. code-block:: bash
59+
.. code-block:: console
6060
61-
sudo dnf install -y \
61+
$ sudo dnf install -y \
6262
cmake \
6363
gcc-c++ \
6464
git \
@@ -76,9 +76,9 @@ If you are going to build ROS packages or otherwise do development, you can also
7676
python3-vcstool \
7777
wget
7878
79-
# install some pip packages needed for testing and
80-
# not available as RPMs
81-
python3 -m pip install -U --user \
79+
~ install some pip packages needed for testing and
80+
~ not available as RPMs
81+
$ python3 -m pip install -U --user \
8282
flake8-blind-except==0.1.1 \
8383
flake8-class-newline \
8484
flake8-deprecated
@@ -93,22 +93,22 @@ Install ROS 2
9393

9494
* Unpack it:
9595

96-
.. code-block:: bash
96+
.. code-block:: console
9797
98-
mkdir -p ~/ros2_{DISTRO}
99-
cd ~/ros2_{DISTRO}
100-
tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2
98+
$ mkdir -p ~/ros2_{DISTRO}
99+
$ cd ~/ros2_{DISTRO}
100+
$ tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2
101101
102102
Install dependencies using rosdep
103103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104

105105
.. include:: ../_Dnf-Update-Admonition.rst
106106

107-
.. code-block:: bash
107+
.. code-block:: console
108108
109-
sudo rosdep init
110-
rosdep update
111-
rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-6.0.1 urdfdom_headers"
109+
$ sudo rosdep init
110+
$ rosdep update
111+
$ rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-6.0.1 urdfdom_headers"
112112
113113
Install additional RMW implementations (optional)
114114
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,28 +121,31 @@ Setup environment
121121

122122
Set up your environment by sourcing the following file.
123123

124-
.. code-block:: bash
124+
.. code-block:: console
125125
126-
# Replace ".bash" with your shell if you're not using bash
127-
# Possible values are: setup.bash, setup.sh, setup.zsh
128-
. ~/ros2_{DISTRO}/ros2-linux/setup.bash
126+
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash
127+
128+
.. note::
129+
130+
Replace ``.bash`` with your shell if you're not using bash.
131+
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.
129132

130133
Try some examples
131134
-----------------
132135

133136
In one terminal, source the setup file and then run a C++ ``talker``:
134137

135-
.. code-block:: bash
138+
.. code-block:: console
136139
137-
. ~/ros2_{DISTRO}/ros2-linux/setup.bash
138-
ros2 run demo_nodes_cpp talker
140+
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash
141+
$ ros2 run demo_nodes_cpp talker
139142
140143
In another terminal source the setup file and then run a Python ``listener``:
141144

142-
.. code-block:: bash
145+
.. code-block:: console
143146
144-
. ~/ros2_{DISTRO}/ros2-linux/setup.bash
145-
ros2 run demo_nodes_py listener
147+
$ . ~/ros2_{DISTRO}/ros2-linux/setup.bash
148+
$ ros2 run demo_nodes_py listener
146149
147150
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
148151
This verifies both the C++ and Python APIs are working properly.
@@ -166,6 +169,6 @@ Uninstall
166169

167170
2. If you're also trying to free up space, you can delete the entire workspace directory with:
168171

169-
.. code-block:: bash
172+
.. code-block:: console
170173
171-
rm -rf ~/ros2_{DISTRO}
174+
$ rm -rf ~/ros2_{DISTRO}

0 commit comments

Comments
 (0)