@@ -38,10 +38,10 @@ Enable required repositories
38
38
The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default.
39
39
They can be enabled by running:
40
40
41
- .. code-block :: bash
41
+ .. code-block :: console
42
42
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
45
45
46
46
.. note :: This step may be slightly different depending on the distribution you are using.
47
47
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart >`_
@@ -54,9 +54,9 @@ Enable required repositories
54
54
Install development tools
55
55
^^^^^^^^^^^^^^^^^^^^^^^^^
56
56
57
- .. code-block :: bash
57
+ .. code-block :: console
58
58
59
- sudo dnf install -y \
59
+ $ sudo dnf install -y \
60
60
cmake \
61
61
gcc-c++ \
62
62
git \
@@ -77,9 +77,9 @@ Install development tools
77
77
python3-vcstool \
78
78
wget
79
79
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 \
83
83
flake8-blind-except==0.1.1 \
84
84
flake8-class-newline \
85
85
flake8-deprecated
@@ -92,22 +92,22 @@ Get ROS 2 code
92
92
93
93
Create a workspace and clone all repos:
94
94
95
- .. code-block :: bash
95
+ .. code-block :: console
96
96
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
100
100
101
101
Install dependencies using rosdep
102
102
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
103
104
104
.. include :: ../_Dnf-Update-Admonition.rst
105
105
106
- .. code-block :: bash
106
+ .. code-block :: console
107
107
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"
111
111
112
112
Install additional RMW implementations (optional)
113
113
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -125,47 +125,50 @@ The output should be empty.
125
125
126
126
More info on working with a ROS workspace can be found in :doc: `this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial >`.
127
127
128
- .. code-block :: bash
128
+ .. code-block :: console
129
129
130
- cd ~ /ros2_{DISTRO}/
131
- colcon build --symlink-install
130
+ $ cd ~/ros2_{DISTRO}/
131
+ $ colcon build --symlink-install
132
132
133
133
.. note ::
134
134
135
135
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.
136
136
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:
137
137
138
- .. code-block :: bash
138
+ .. code-block :: console
139
139
140
- colcon build --symlink-install --packages-skip image_tools intra_process_demo
140
+ $ colcon build --symlink-install --packages-skip image_tools intra_process_demo
141
141
142
142
Setup environment
143
143
-----------------
144
144
145
145
Set up your environment by sourcing the following file.
146
146
147
- .. code-block :: bash
147
+ .. code-block :: console
148
148
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 ``.
152
155
153
156
Try some examples
154
157
-----------------
155
158
156
159
In one terminal, source the setup file and then run a C++ ``talker ``\ :
157
160
158
- .. code-block :: bash
161
+ .. code-block :: console
159
162
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
162
165
163
166
In another terminal source the setup file and then run a Python ``listener ``\ :
164
167
165
- .. code-block :: bash
168
+ .. code-block :: console
166
169
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
169
172
170
173
You should see the ``talker `` saying that it's ``Publishing `` messages and the ``listener `` saying ``I heard `` those messages.
171
174
This verifies both the C++ and Python APIs are working properly.
@@ -187,12 +190,12 @@ Clang
187
190
188
191
To configure CMake to detect and use Clang:
189
192
190
- .. code-block :: bash
193
+ .. code-block :: console
191
194
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
196
199
197
200
Stay up to date
198
201
---------------
@@ -212,6 +215,6 @@ Uninstall
212
215
213
216
2. If you're also trying to free up space, you can delete the entire workspace directory with:
214
217
215
- .. code-block :: bash
218
+ .. code-block :: console
216
219
217
- rm -rf ~ /ros2_{DISTRO}
220
+ $ rm -rf ~/ros2_{DISTRO}
0 commit comments