Skip to content

Commit f022c60

Browse files
Nils-ChristianIsekemergify[bot]
authored andcommitted
Add $ to Installation (#5356)
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) # Conflicts: # source/Installation/RHEL-Install-RPMs.rst # source/Installation/Ubuntu-Install-Debs.rst # source/Installation/Windows-Install-Binary.rst # source/Installation/_Apt-Upgrade-Admonition.rst # source/Installation/_Dnf-Update-Admonition.rst
1 parent 398eb97 commit f022c60

10 files changed

+284
-126
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

+66-21
Original file line numberDiff line numberDiff line change
@@ -30,47 +30,85 @@ Setup Sources
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+
<<<<<<< HEAD
3536
sudo dnf install 'dnf-command(config-manager)' epel-release -y
3637
sudo dnf config-manager --set-enabled powertools
38+
=======
39+
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
40+
$ sudo dnf config-manager --set-enabled crb
41+
>>>>>>> b3d8114 (Add $ to Installation (#5356))
3742

3843
.. note:: This step may be slightly different depending on the distribution you are using.
3944
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_
4045

4146
Next, download the ROS 2 ``.repo`` file:
4247

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

51-
.. code-block:: bash
56+
.. code-block:: console
5257
53-
sudo dnf makecache
58+
$ sudo dnf makecache
5459
5560
.. _rhel-install-rpms-install-ros-2-packages:
5661

62+
<<<<<<< HEAD
5763
Install ROS 2 packages
5864
----------------------
65+
=======
66+
If you are going to build ROS packages or otherwise do development, you can also install the development tools:
67+
68+
.. code-block:: console
69+
70+
$ sudo dnf install -y \
71+
cmake \
72+
gcc-c++ \
73+
git \
74+
make \
75+
patch \
76+
python3-colcon-common-extensions \
77+
python3-mypy \
78+
python3-pip \
79+
python3-pytest \
80+
python3-pytest-repeat \
81+
python3-pytest-rerunfailures \
82+
python3-rosdep \
83+
python3-setuptools \
84+
python3-vcstool \
85+
wget
86+
87+
~ install some pip packages needed for testing and
88+
~ not available as RPMs
89+
$ python3 -m pip install -U --user \
90+
flake8-blind-except==0.1.1 \
91+
flake8-class-newline \
92+
flake8-deprecated
93+
94+
Install ROS 2
95+
-------------
96+
>>>>>>> b3d8114 (Add $ to Installation (#5356))
5997

6098
.. include:: _Dnf-Update-Admonition.rst
6199

62100
Desktop Install (Recommended): ROS, RViz, demos, tutorials.
63101

64-
.. code-block:: bash
102+
.. code-block:: console
65103
66-
sudo dnf install ros-{DISTRO}-desktop
104+
$ sudo dnf install ros-{DISTRO}-desktop
67105
68106
ROS-Base Install (Bare Bones): Communication libraries, message packages, command line tools.
69107
No GUI tools.
70108

71-
.. code-block:: bash
109+
.. code-block:: console
72110
73-
sudo dnf install ros-{DISTRO}-ros-base
111+
$ sudo dnf install ros-{DISTRO}-ros-base
74112
75113
Environment setup
76114
-----------------
@@ -80,11 +118,14 @@ Sourcing the setup script
80118

81119
Set up your environment by sourcing the following file.
82120

83-
.. code-block:: bash
121+
.. code-block:: console
122+
123+
$ source /opt/ros/{DISTRO}/setup.bash
124+
125+
.. note::
84126

85-
# Replace ".bash" with your shell if you're not using bash
86-
# Possible values are: setup.bash, setup.sh, setup.zsh
87-
source /opt/ros/{DISTRO}/setup.bash
127+
Replace ``.bash`` with your shell if you're not using console.
128+
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.
88129

89130
Try some examples
90131
-----------------
@@ -93,17 +134,17 @@ If you installed ``ros-{DISTRO}-desktop`` above you can try some examples.
93134

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

96-
.. code-block:: bash
137+
.. code-block:: console
97138
98-
source /opt/ros/{DISTRO}/setup.bash
99-
ros2 run demo_nodes_cpp talker
139+
$ source /opt/ros/{DISTRO}/setup.bash
140+
$ ros2 run demo_nodes_cpp talker
100141
101142
In another terminal source the setup file and then run a Python ``listener``\ :
102143

103-
.. code-block:: bash
144+
.. code-block:: console
104145
105-
source /opt/ros/{DISTRO}/setup.bash
106-
ros2 run demo_nodes_py listener
146+
$ source /opt/ros/{DISTRO}/setup.bash
147+
$ ros2 run demo_nodes_py listener
107148
108149
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
109150
This verifies both the C++ and Python APIs are working properly.
@@ -129,6 +170,10 @@ Uninstall
129170
If you need to uninstall ROS 2 or switch to a source-based install once you
130171
have already installed from binaries, run the following command:
131172

132-
.. code-block:: bash
173+
.. code-block:: console
133174
175+
<<<<<<< HEAD
134176
sudo dnf remove ros-{DISTRO}-*
177+
=======
178+
$ sudo dnf remove ros-{DISTRO}-*
179+
>>>>>>> b3d8114 (Add $ to Installation (#5356))

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 Jammy 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 jammy main
3232
deb http://packages.ros.org/ros2-testing/ubuntu jammy 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 jammy main
5757
# deb http://packages.ros.org/ros2-testing/ubuntu jammy 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)