Skip to content

Commit 18208bd

Browse files
Use proper code blocks and format some paths in Windows instructions (ros2#1316)
Signed-off-by: Christophe Bedard <[email protected]>
1 parent bc65979 commit 18208bd

File tree

4 files changed

+56
-60
lines changed

4 files changed

+56
-60
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ If you wish to checkout the latest code for ROS 2 {DISTRO_TITLE}, you can get th
5151
.. code-block:: bash
5252
5353
# CMD
54-
> cd \dev\ros2_{DISTRO}
55-
> curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
54+
cd \dev\ros2_{DISTRO}
55+
curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
5656
5757
# PowerShell
58-
> cd \dev\ros2_{DISTRO}
59-
> curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
58+
cd \dev\ros2_{DISTRO}
59+
curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
6060
6161
6262
Update your repositories
@@ -96,12 +96,12 @@ You should now be able to download the sources associated with the new repositor
9696
.. code-block:: bash
9797
9898
# CMD
99-
> vcs import src < ros2.repos
100-
> vcs pull src
99+
vcs import src < ros2.repos
100+
vcs pull src
101101
102102
# PowerShell
103-
> vcs import --input ros2.repos src
104-
> vcs pull src
103+
vcs import --input ros2.repos src
104+
vcs pull src
105105
106106
Rebuild your workspace
107107
----------------------
@@ -138,7 +138,7 @@ If you wish to know the versions of the set of repositories in your workspace, y
138138

139139
.. code-block:: bash
140140
141-
> cd \dev\ros2_{DISTRO}
142-
> vcs export src > my_ros2.repos
141+
cd \dev\ros2_{DISTRO}
142+
vcs export src > my_ros2.repos
143143
144144
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/Windows-Development-Setup.rst

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Install additional prerequisites from Chocolatey
3232

3333
.. code-block:: bash
3434
35-
> choco install -y cppcheck curl git winflexbison3
35+
choco install -y cppcheck curl git winflexbison3
3636
3737
You will need to append the Git cmd folder ``C:\Program Files\Git\cmd`` to the PATH (you can do this by clicking the Windows icon, typing "Environment Variables", then clicking on "Edit the system environment variables".
3838
In the resulting dialog, click "Environment Variables", the click "Path" on the bottom pane, then click "Edit" and add the path).
@@ -45,7 +45,7 @@ Installing additional Python dependencies:
4545

4646
.. code-block:: bash
4747
48-
> pip install -U colcon-common-extensions coverage flake8 flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes mock mypy==0.761 pep8 pydocstyle pytest pytest-mock vcstool
48+
pip install -U colcon-common-extensions coverage flake8 flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes mock mypy==0.761 pep8 pydocstyle pytest pytest-mock vcstool
4949
5050
Install miscellaneous prerequisites
5151
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -65,28 +65,28 @@ First setup a development folder, for example ``C:\dev\ros2_{DISTRO}``:
6565

6666
.. code-block:: bash
6767
68-
> md \dev\ros2_{DISTRO}\src
69-
> cd \dev\ros2_{DISTRO}
68+
md \dev\ros2_{DISTRO}\src
69+
cd \dev\ros2_{DISTRO}
7070
7171
Get the ``ros2.repos`` file which defines the repositories to clone from:
7272

7373
.. code-block:: bash
7474
7575
# CMD
76-
> curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
76+
curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
7777
7878
# PowerShell
79-
> curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
79+
curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
8080
8181
Next you can use ``vcs`` to import the repositories listed in the ``ros2.repos`` file:
8282

8383
.. code-block:: bash
8484
8585
# CMD
86-
> vcs import src < ros2.repos
86+
vcs import src < ros2.repos
8787
8888
# PowerShell
89-
> vcs import --input ros2.repos src
89+
vcs import --input ros2.repos src
9090
9191
Install additional DDS implementations (optional)
9292
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,7 +106,7 @@ To build the ``\dev\ros2_{DISTRO}`` folder tree:
106106

107107
.. code-block:: bash
108108
109-
> colcon build --merge-install
109+
colcon build --merge-install
110110
111111
.. note::
112112

@@ -125,7 +125,7 @@ Start a command shell and source the ROS 2 setup file to set up the workspace:
125125

126126
.. code-block:: bash
127127
128-
> call C:\dev\ros2_{DISTRO}\install\local_setup.bat
128+
call C:\dev\ros2_{DISTRO}\install\local_setup.bat
129129
130130
This will automatically set up the environment for any DDS vendors that support was built for.
131131

@@ -140,7 +140,7 @@ You can run the tests using this command:
140140

141141
.. code-block:: bash
142142
143-
> colcon test --merge-install
143+
colcon test --merge-install
144144
145145
.. note::
146146

@@ -150,22 +150,22 @@ Afterwards you can get a summary of the tests using this command:
150150

151151
.. code-block:: bash
152152
153-
> colcon test-result
153+
colcon test-result
154154
155155
To run the examples, first open a clean new ``cmd.exe`` and set up the workspace by sourcing the ``local_setup.bat`` file.
156156
Then, run a C++ ``talker``\ :
157157

158158
.. code-block:: bash
159159
160-
> call install\local_setup.bat
161-
> ros2 run demo_nodes_cpp talker
160+
call install\local_setup.bat
161+
ros2 run demo_nodes_cpp talker
162162
163163
In a separate shell you can do the same, but instead run a Python ``listener``\ :
164164

165165
.. code-block:: bash
166166
167-
> call install\local_setup.bat
168-
> ros2 run demo_nodes_py listener
167+
call install\local_setup.bat
168+
ros2 run demo_nodes_py listener
169169
170170
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
171171
This verifies both the C++ and Python APIs are working properly.
@@ -200,14 +200,14 @@ If you want to be able to run all the tests in Debug mode, you'll need to instal
200200

201201
.. code-block:: bash
202202
203-
> choco install -y peazip
203+
choco install -y peazip
204204
205205
206206
* You'll also need SVN, since some of the Python source-build dependencies are checked out via SVN:
207207

208208
.. code-block:: bash
209209
210-
> choco install -y svn hg
210+
choco install -y svn hg
211211
212212
213213
* You'll need to quit and restart the command prompt after installing the above.
@@ -220,59 +220,55 @@ If you want to be able to run all the tests in Debug mode, you'll need to instal
220220

221221
.. code-block:: bash
222222
223-
> cd C:\dev\Python-3.8.3\PCbuild
224-
> get_externals.bat
225-
> build.bat -p x64 -d
223+
cd C:\dev\Python-3.8.3\PCbuild
224+
get_externals.bat
225+
build.bat -p x64 -d
226226
227227
228228
* Finally, copy the build products into the Python38 installation directories, next to the Release-mode Python executable and DLL's:
229229

230230
.. code-block:: bash
231231
232-
> cd C:\dev\Python-3.8.3\PCbuild\amd64
233-
> copy python_d.exe C:\Python38 /Y
234-
> copy python38_d.dll C:\Python38 /Y
235-
> copy python3_d.dll C:\Python38 /Y
236-
> copy python38_d.lib C:\Python38\libs /Y
237-
> copy python3_d.lib C:\Python38\libs /Y
238-
> for %I in (*_d.pyd) do copy %I C:\Python38\DLLs /Y
232+
cd C:\dev\Python-3.8.3\PCbuild\amd64
233+
copy python_d.exe C:\Python38 /Y
234+
copy python38_d.dll C:\Python38 /Y
235+
copy python3_d.dll C:\Python38 /Y
236+
copy python38_d.lib C:\Python38\libs /Y
237+
copy python3_d.lib C:\Python38\libs /Y
238+
for %I in (*_d.pyd) do copy %I C:\Python38\DLLs /Y
239239
240240
241241
* Now, from a fresh command prompt, make sure that ``python_d`` works:
242242
243243
.. code-block:: bash
244244
245-
> python_d
246-
> import _ctypes
245+
python_d -c "import _ctypes"
247246
248247
* Once you have verified the operation of ``python_d``, it is necessary to reinstall a few dependencies with the debug-enabled libraries:
249248
250249
.. code-block:: bash
251250
252-
> python_d -m pip install --force-reinstall https://github.com/ros2/ros2/releases/download/numpy-archives/numpy-1.18.4-cp38-cp38d-win_amd64.whl
253-
> python_d -m pip install --force-reinstall https://github.com/ros2/ros2/releases/download/lxml-archives/lxml-4.5.1-cp38-cp38d-win_amd64.whl
251+
python_d -m pip install --force-reinstall https://github.com/ros2/ros2/releases/download/numpy-archives/numpy-1.18.4-cp38-cp38d-win_amd64.whl
252+
python_d -m pip install --force-reinstall https://github.com/ros2/ros2/releases/download/lxml-archives/lxml-4.5.1-cp38-cp38d-win_amd64.whl
254253
255254
* To verify the installation of these dependencies:
256255
257256
.. code-block:: bash
258257
259-
> python_d
260-
# No import errors should appear when executing the following lines
261-
> from lxml import etree
262-
> import numpy
258+
python_d -c "from lxml import etree ; import numpy"
263259
264260
* When you wish to return to building release binaries, it is necessary to uninstall the debug variants and use the release variants:
265261
266262
.. code-block:: bash
267263
268-
> python -m pip uninstall numpy lxml
269-
> python -m pip install numpy lxml
264+
python -m pip uninstall numpy lxml
265+
python -m pip install numpy lxml
270266
271267
* To create executables python scripts(.exe), python_d should be used to invoke colcon
272268
273269
.. code-block:: bash
274270
275-
> python_d path\to\colcon_executable build
271+
python_d path\to\colcon_executable build
276272
277273
* Hooray, you're done!
278274
@@ -296,4 +292,4 @@ Uninstall
296292
297293
.. code-block:: bash
298294
299-
rmdir /s /q \ros2_{DISTRO}
295+
rmdir /s /q \ros2_{DISTRO}

source/Installation/Windows-Install-Binary.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Start a command shell and source the ROS 2 setup file to set up the workspace:
4747

4848
.. code-block:: bash
4949
50-
> call C:\dev\ros2_{DISTRO}\local_setup.bat
50+
call C:\dev\ros2_{DISTRO}\local_setup.bat
5151
5252
It is normal that the previous command, if nothing else went wrong, outputs "The system cannot find the path specified." exactly once.
5353

@@ -58,13 +58,13 @@ In a command shell, set up the ROS 2 environment as described above and then run
5858

5959
.. code-block:: bash
6060
61-
> ros2 run demo_nodes_cpp talker
61+
ros2 run demo_nodes_cpp talker
6262
6363
Start another command shell and run a Python ``listener``\ :
6464

6565
.. code-block:: bash
6666
67-
> ros2 run demo_nodes_py listener
67+
ros2 run demo_nodes_py listener
6868
6969
You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
7070
This verifies both the C++ and Python APIs are working properly.
@@ -99,4 +99,4 @@ Uninstall
9999

100100
.. code-block:: bash
101101
102-
rmdir /s /q \ros2_{DISTRO}
102+
rmdir /s /q \ros2_{DISTRO}

source/Installation/_Windows-Install-Prerequisites.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Open a Command Prompt and type the following to install Python via Chocolatey:
1717

1818
.. code-block:: bash
1919
20-
> choco install -y python --version 3.8.3
20+
choco install -y python --version 3.8.3
2121
2222
Install Visual C++ Redistributables
2323
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ Open a Command Prompt and type the following to install them via Chocolatey:
2626

2727
.. code-block:: bash
2828
29-
> choco install -y vcredist2013 vcredist140
29+
choco install -y vcredist2013 vcredist140
3030
3131
Install OpenSSL
3232
^^^^^^^^^^^^^^^
@@ -97,7 +97,7 @@ As some chocolatey packages rely on it, we start by installing CMake
9797

9898
.. code-block:: bash
9999
100-
> choco install -y cmake
100+
choco install -y cmake
101101
102102
You will need to append the CMake bin folder ``C:\Program Files\CMake\bin`` to your PATH.
103103

@@ -115,7 +115,7 @@ Once these packages are downloaded, open an administrative shell and execute the
115115

116116
.. code-block:: bash
117117
118-
> choco install -y -s <PATH\TO\DOWNLOADS\> asio cunit eigen tinyxml-usestl tinyxml2 log4cxx bullet
118+
choco install -y -s <PATH\TO\DOWNLOADS\> asio cunit eigen tinyxml-usestl tinyxml2 log4cxx bullet
119119
120120
Please replace ``<PATH\TO\DOWNLOADS>`` with the folder you downloaded the packages to.
121121

@@ -149,8 +149,8 @@ Finally, set the ``Qt5_DIR`` environment variable in the ``cmd.exe`` where you i
149149

150150
.. code-block:: bash
151151
152-
> set Qt5_DIR=C:\Qt\5.15.0\msvc2019_64
153-
> set QT_QPA_PLATFORM_PLUGIN_PATH=C:\Qt\5.15.0\msvc2019_64\plugins\platforms
152+
set Qt5_DIR=C:\Qt\5.15.0\msvc2019_64
153+
set QT_QPA_PLATFORM_PLUGIN_PATH=C:\Qt\5.15.0\msvc2019_64\plugins\platforms
154154
155155
You could set it permanently with ``setx -m Qt5_DIR C:\Qt\5.15.0\msvc2019_64`` and ``setx -m QT_QPA_PLATFORM_PLUGIN_PATH C:\Qt\5.15.0\msvc2019_64\plugins\platforms`` instead, but that requires Administrator.
156156

0 commit comments

Comments
 (0)