Skip to content

Commit b925184

Browse files
mergify[bot]Nils-ChristianIsekechristophebedard
authored
Add $ to Installation (backport #5356) (#5376)
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 b3d8114) Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Nils-Christian Iseke <[email protected]> Co-authored-by: Christophe Bedard <[email protected]>
1 parent 2a5cc5c commit b925184

10 files changed

+160
-149
lines changed

source/Installation/Maintaining-a-Source-Checkout.rst

+49-41
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,35 @@ If you wish to checkout the latest code for ROS 2 {DISTRO_TITLE}, you can get th
3232

3333
.. group-tab:: Linux
3434

35-
.. code-block:: bash
35+
.. code-block:: console
3636
37-
cd ~/ros2_{DISTRO}
38-
mv -i ros2.repos ros2.repos.old
39-
wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
37+
$ cd ~/ros2_{DISTRO}
38+
$ mv -i ros2.repos ros2.repos.old
39+
$ wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
4040
4141
.. group-tab:: macOS
4242

43-
.. code-block:: bash
43+
.. code-block:: console
4444
45-
cd ~/ros2_{DISTRO}
46-
mv -i ros2.repos ros2.repos.old
47-
wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
45+
$ cd ~/ros2_{DISTRO}
46+
$ mv -i ros2.repos ros2.repos.old
47+
$ wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
4848
4949
.. group-tab:: Windows
5050

51-
.. code-block:: bash
51+
Use a Windows comand line interface:
5252

53-
# CMD
54-
cd \dev\ros2_{DISTRO}
55-
curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
53+
.. code-block:: console
5654
57-
# PowerShell
58-
cd \dev\ros2_{DISTRO}
59-
curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
55+
$ cd \dev\ros2_{DISTRO}
56+
$ curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
57+
58+
Or a powershell:
59+
60+
.. code-block:: console
61+
62+
$ cd \dev\ros2_{DISTRO}
63+
$ curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
6064
6165
6266
Update your repositories
@@ -66,9 +70,9 @@ You will notice that in the `ros2.repos <https://raw.githubusercontent.com/ros2/
6670
It is possible that these versions refer to new tags/branches that your local copy of the repositories will not recognize as they are out-of-date.
6771
Because of this, you should update the repositories that you have already checked out with the following command:
6872

69-
.. code-block:: bash
73+
.. code-block:: console
7074
71-
vcs custom --args remote update
75+
$ vcs custom --args remote update
7276
7377
Download the new source code
7478
----------------------------
@@ -79,38 +83,42 @@ You should now be able to download the sources associated with the new repositor
7983

8084
.. group-tab:: Linux
8185

82-
.. code-block:: bash
86+
.. code-block:: console
8387
84-
vcs import src < ros2.repos
85-
vcs pull src
88+
$ vcs import src < ros2.repos
89+
$ vcs pull src
8690
8791
.. group-tab:: macOS
8892

89-
.. code-block:: bash
93+
.. code-block:: console
9094
91-
vcs import src < ros2.repos
92-
vcs pull src
95+
$ vcs import src < ros2.repos
96+
$ vcs pull src
9397
9498
.. group-tab:: Windows
9599

96-
.. code-block:: bash
100+
In a Windows command line interface:
101+
102+
.. code-block:: console
103+
104+
$ vcs import --input ros2.repos src
105+
$ vcs pull src
106+
107+
Or in powershell:
97108

98-
# CMD
99-
vcs import src < ros2.repos
100-
vcs pull src
109+
.. code-block:: console
101110
102-
# PowerShell
103-
vcs import --input ros2.repos src
104-
vcs pull src
111+
$ vcs import --input ros2.repos src
112+
$ vcs pull src
105113
106114
Rebuild your workspace
107115
----------------------
108116

109117
Now that the workspace is up to date with the latest sources, remove your previous install and rebuild your workspace with, for example:
110118

111-
.. code-block:: bash
119+
.. code-block:: console
112120
113-
colcon build --symlink-install
121+
$ colcon build --symlink-install
114122
115123
Inspect your source checkout
116124
----------------------------
@@ -122,23 +130,23 @@ If you wish to know the versions of the set of repositories in your workspace, y
122130

123131
.. group-tab:: Linux
124132

125-
.. code-block:: bash
133+
.. code-block:: console
126134
127-
cd ~/ros2_{DISTRO}
128-
vcs export src > my_ros2.repos
135+
$ cd ~/ros2_{DISTRO}
136+
$ vcs export src > my_ros2.repos
129137
130138
.. group-tab:: macOS
131139

132-
.. code-block:: bash
140+
.. code-block:: console
133141
134-
cd ~/ros2_{DISTRO}
135-
vcs export src > my_ros2.repos
142+
$ cd ~/ros2_{DISTRO}
143+
$ vcs export src > my_ros2.repos
136144
137145
.. group-tab:: Windows
138146

139-
.. code-block:: bash
147+
.. code-block:: console
140148
141-
cd \dev\ros2_{DISTRO}
142-
vcs export src > my_ros2.repos
149+
$ cd \dev\ros2_{DISTRO}
150+
$ vcs export src > my_ros2.repos
143151
144152
This ``my_ros2.repos`` file can then be shared with others so that they can reproduce the state of the repositories in your workspace.

source/Installation/RHEL-Install-RPMs.rst

+32-29
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,36 @@ Enable required repositories
3030

3131
You will need to enable the EPEL repositories and the PowerTools repository:
3232

33-
.. code-block:: bash
33+
.. code-block:: console
3434
35-
sudo dnf install 'dnf-command(config-manager)' epel-release -y
36-
sudo dnf config-manager --set-enabled crb
35+
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
36+
$ sudo dnf config-manager --set-enabled crb
3737
3838
.. note:: This step may be slightly different depending on the distribution you are using.
3939
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
4040

4141
Next, download the ROS 2 ``.repo`` file:
4242

43-
.. code-block:: bash
43+
.. code-block:: console
4444
45-
sudo dnf install curl
46-
sudo curl --output /etc/yum.repos.d/ros2.repo http://packages.ros.org/ros2/rhel/ros2.repo
45+
$ sudo dnf install curl
46+
$ sudo curl --output /etc/yum.repos.d/ros2.repo http://packages.ros.org/ros2/rhel/ros2.repo
4747
4848
Then, update your metadata cache.
4949
DNF may prompt you to verify the GPG key, which should match the location ``https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc``.
5050

51-
.. code-block:: bash
51+
.. code-block:: console
5252
53-
sudo dnf makecache
53+
$ sudo dnf makecache
5454
5555
Install development tools (optional)
5656
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5757

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

60-
.. code-block:: bash
60+
.. code-block:: console
6161
62-
sudo dnf install -y \
62+
$ sudo dnf install -y \
6363
cmake \
6464
gcc-c++ \
6565
git \
@@ -77,9 +77,9 @@ If you are going to build ROS packages or otherwise do development, you can also
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
@@ -91,16 +91,16 @@ Install ROS 2
9191

9292
Desktop Install (Recommended): ROS, RViz, demos, tutorials.
9393

94-
.. code-block:: bash
94+
.. code-block:: console
9595
96-
sudo dnf install ros-{DISTRO}-desktop
96+
$ sudo dnf install ros-{DISTRO}-desktop
9797
9898
ROS-Base Install (Bare Bones): Communication libraries, message packages, command line tools.
9999
No GUI tools.
100100

101-
.. code-block:: bash
101+
.. code-block:: console
102102
103-
sudo dnf install ros-{DISTRO}-ros-base
103+
$ sudo dnf install ros-{DISTRO}-ros-base
104104
105105
Install additional RMW implementations (optional)
106106
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -113,11 +113,14 @@ Setup environment
113113

114114
Set up your environment by sourcing the following file.
115115

116-
.. code-block:: bash
116+
.. code-block:: console
117117
118-
# Replace ".bash" with your shell if you're not using bash
119-
# Possible values are: setup.bash, setup.sh, setup.zsh
120-
source /opt/ros/{DISTRO}/setup.bash
118+
$ source /opt/ros/{DISTRO}/setup.bash
119+
120+
.. note::
121+
122+
Replace ``.bash`` with your shell if you're not using console.
123+
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.
121124

122125
Try some examples
123126
-----------------
@@ -126,17 +129,17 @@ If you installed ``ros-{DISTRO}-desktop`` above you can try some examples.
126129

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

129-
.. code-block:: bash
132+
.. code-block:: console
130133
131-
source /opt/ros/{DISTRO}/setup.bash
132-
ros2 run demo_nodes_cpp talker
134+
$ source /opt/ros/{DISTRO}/setup.bash
135+
$ ros2 run demo_nodes_cpp talker
133136
134137
In another terminal source the setup file and then run a Python ``listener``\ :
135138

136-
.. code-block:: bash
139+
.. code-block:: console
137140
138-
source /opt/ros/{DISTRO}/setup.bash
139-
ros2 run demo_nodes_py listener
141+
$ source /opt/ros/{DISTRO}/setup.bash
142+
$ ros2 run demo_nodes_py listener
140143
141144
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
142145
This verifies both the C++ and Python APIs are working properly.
@@ -158,6 +161,6 @@ Uninstall
158161
If you need to uninstall ROS 2 or switch to a source-based install once you
159162
have already installed from binaries, run the following command:
160163

161-
.. code-block:: bash
164+
.. code-block:: console
162165
163-
sudo dnf remove ros-{DISTRO}-*
166+
$ sudo dnf remove ros-{DISTRO}-*

source/Installation/Testing.rst

+19-19
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,42 @@ For Debian-based operating systems, you can install binary packages from the **r
2626
2. Edit (with sudo) the file ``/etc/apt/sources.list.d/ros2.list`` and change ``ros2`` with ``ros2-testing``.
2727
For example, on Ubuntu Noble the contents should look like the following:
2828

29-
.. code-block:: sh
29+
.. code-block:: bash
3030
3131
# deb http://packages.ros.org/ros2/ubuntu noble main
3232
deb http://packages.ros.org/ros2-testing/ubuntu noble main
3333
3434
3. Update the ``apt`` index:
3535

36-
.. code-block:: sh
36+
.. code-block:: console
3737
38-
sudo apt update
38+
$ sudo apt update
3939
4040
4. You can now install individual packages from the testing repository, for example:
4141

42-
.. code-block:: sh
42+
.. code-block:: console
4343
44-
sudo apt install ros-{DISTRO}-my-just-released-package
44+
$ sudo apt install ros-{DISTRO}-my-just-released-package
4545
4646
5. Alternatively, you can move your entire ROS 2 installation to the testing repository:
4747

48-
.. code-block:: sh
48+
.. code-block:: console
4949
50-
sudo apt dist-upgrade
50+
$ sudo apt dist-upgrade
5151
5252
6. Once you are finished testing, you can switch back to the normal repository by changing back the contents of ``/etc/apt/sources.list.d/ros2.list``:
5353

54-
.. code-block:: sh
54+
.. code-block:: bash
5555
5656
deb http://packages.ros.org/ros2/ubuntu noble main
5757
# deb http://packages.ros.org/ros2-testing/ubuntu noble main
5858
5959
and doing an update and upgrade:
6060

61-
.. code-block:: sh
61+
.. code-block:: console
6262
63-
sudo apt update
64-
sudo apt dist-upgrade
63+
$ sudo apt update
64+
$ sudo apt dist-upgrade
6565
6666
.. _Prerelease_binaries:
6767

@@ -85,15 +85,15 @@ These packaging jobs produce archives with pre-built binaries that can be downlo
8585

8686
.. group-tab:: Ubuntu Linux and RHEL
8787

88-
.. code-block:: sh
88+
.. code-block:: console
8989
90-
source path/to/extracted/archive/setup.bash
90+
$ source path/to/extracted/archive/setup.bash
9191
9292
.. group-tab:: Windows
9393

94-
.. code-block:: sh
94+
.. code-block:: console
9595
96-
call path\to\extracted\archive\setup.bat
96+
$ call path\to\extracted\archive\setup.bat
9797
9898
Docker
9999
------
@@ -102,14 +102,14 @@ For Ubuntu Linux, there is also a nightly Docker image based on the nightly bina
102102

103103
1. Pull the Docker image:
104104

105-
.. code-block:: sh
105+
.. code-block:: console
106106
107-
docker pull osrf/ros2:nightly
107+
$ docker pull osrf/ros2:nightly
108108
109109
2. Start an interactive container:
110110

111-
.. code-block:: sh
111+
.. code-block:: console
112112
113-
docker run -it osrf/ros2:nightly
113+
$ docker run -it osrf/ros2:nightly
114114
115115
For support on running GUI applications in Docker, take a look at the tutorial `User GUI's with Docker <https://wiki.ros.org/docker/Tutorials/GUI>`_ or the tool `rocker <https://github.com/osrf/rocker>`_.

0 commit comments

Comments
 (0)