1 windows 下安装ros2-dashing
1.1 下载安装软件Chocolatey
Chocolatey is a package manager for Windows, install it by following their installation instructions:
https://chocolatey.org/
You’ll use Chocolatey to install some other developer tools.
#安装windows软件包工具 choco, 管理员身份打开cmd执行如下指令安装
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
# 创客智造网站
https://www.ncnynl.com/archives/201801/2254.html
# ros2view 网站,关于windows安装ros2-dashing版本
https://index.ros.org/doc/ros2/Installation/Dashing/Windows-Install-Binary/
1.2 安装 ROS 2 on Windows
# win10操作系统 才支持ros2
As of beta-2 only Windows 10 is supported.
1.3 安装 Python
Open a Command Prompt and type the following to install Python via Chocolatey:
> choco install -y python --version 3.7.5
#注意python版本一定不能错,如果命令行下载不下来,可去python官网下载.否则会出现莫名其妙错误,我开始下载
#python3.8 运行ros2 出现 failed to create process 错误.
# https://www.python.org/downloads/windows/
1.4 安装 Visual C++ Redistributables
Open a Command Prompt and type the following to install them via Chocolatey:
> choco install -y vcredist2013 vcredist140
1.5 Install OpenSSL¶
# https://slproweb.com/products/Win32OpenSSL.html 下载openssl
Download the Win64 OpenSSL v1.0.2u OpenSSL installer from this page. Scroll to the bottom of the page and download Win64 OpenSSL v1.0.2u. Don’t download the Win32 or Light versions or version 1.1.0 or newer.
Run the installer with default parameters. The following commands assume you used the default installation directory:
setx -m OPENSSL_CONF C:\OpenSSL-Win64\bin\openssl.cfg
You will need to append the OpenSSL-Win64 bin folder to your PATH. You can do this by clicking the Windows icon, typing “Environment Variables”, then clicking on “Edit the system environment variables”. In the resulting dialog, click “Environment Variables”, then click “Path” on the bottom pane, finally click “Edit” and add the path below.
C:\OpenSSL-Win64\bin\
1.6 Install Visual Studio¶
Install Visual Studio 2019.
If you already have a paid version of Visual Studio 2019 (Professional, Enterprise), skip this step.
Microsoft provides a free of charge version of Visual Studio 2019, named Community, which can be used to build applications that use ROS 2:
https://visualstudio.microsoft.com/downloads/
Make sure that the Visual C++ features are installed.
An easy way to make sure they’re installed is to select the Desktop development with C++
workflow during the install.
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Gyj6go6I-1596417333380)(https://i.imgur.com/2h0IxCk.png)]
Make sure that no C++ CMake tools are installed by unselecting them in the list of components to be installed.
1.7 Install additional DDS implementations (optional)¶
If you would like to use another DDS or RTPS vendor besides the default, eProsima’s Fast RTPS, you can find instructions here.
可选安装 默认自带有dds
安装dds
set "NDDSHOME=C:\Program Files\rti_connext_dds-5.3.1"
1.8 Install OpenCV¶
Some of the examples require OpenCV to be installed.
You can download a precompiled version of OpenCV 3.4.6 from https://github.com/ros2/ros2/releases/download/opencv-archives/opencv-3.4.6-vc16.VS2019.zip .
Assuming you unpacked it to C:\opencv
, type the following on a Command Prompt (requires Admin privileges):
setx -m OpenCV_DIR C:\opencv
Since you are using a precompiled ROS version, we have to tell it where to find the OpenCV libraries. You have to extend the PATH
variable to C:\opencv\x64\vc16\bin
.
1.9 Install dependencies¶
There are a few dependencies not available in the Chocolatey package database. In order to ease the manual installation process, we provide the necessary Chocolatey packages.
As some chocolatey packages rely on it, we start by installing CMake
> choco install -y cmake
# 如果已经安装完毕,可跳过. cmake version 3.16.4 我当前系统安装cmake版本.
You will need to append the CMake bin folder C:\Program Files\CMake\bin
to your PATH.
Please download these packages from this GitHub repository.
- asio.1.12.1.nupkg
- cunit.2.1.3.nupkg
- eigen-3.3.4.nupkg
- tinyxml-usestl.2.6.2.nupkg
- tinyxml2.6.0.0.nupkg
- log4cxx.0.10.0.nupkg
Once these packages are downloaded, open an administrative shell and execute the following command:
> choco install -y -s <PATH\TO\DOWNLOADS\> asio cunit eigen tinyxml-usestl tinyxml2 log4cxx
# <PATH\TO\DOWNLOADS\> 代表的是本地下载二进制文件的存储路径
# 上述命令即是本地安装
Please replace `` with the folder you downloaded the packages to.
You must also install some python dependencies for command-line tools:
python -m pip install -U catkin_pkg empy lark-parser lxml numpy opencv-python pyparsing pyyaml setuptools
RQt dependencies
python -m pip install -U pydot PyQt5
1.10 Downloading ROS 2¶
- Go the releases page: https://github.com/ros2/ros2/releases
- Download the latest package for Windows, e.g.,
ros2-dashing-*-windows-AMD64.zip
.
Note
There may be more than one binary download option which might cause the file name to differ.
Note
To download the ROS 2 debug libraries you’ll need to download ros2-dashing-*-windows-debug-AMD64.zip
- Unpack the zip file somewhere (we’ll assume
C:\dev\ros2_dashing
).
1.11 Environment setup¶
Start a command shell and source the ROS 2 setup file to set up the workspace:
> call C:\dev\ros2_dashing\local_setup.bat
It is normal that the previous command, if nothing else went wrong, outputs “The system cannot find the path specified.” exactly once.
1.12 Try some examples¶
In a command shell, set up the ROS 2 environment as described above and then run a C++ talker
:
> ros2 run demo_nodes_cpp talker
Start another command shell and run a Python listener
:
> ros2 run demo_nodes_py listener
You should see the talker
saying that it’s Publishing
messages and the listener
saying I heard
those messages. This verifies both the C++ and Python APIs are working properly. Hooray!
See the tutorials and demos for other things to try.
1.13 Build your own packages¶
If you would like to build your own packages, refer to the tutorial “Using Colcon to build packages”.
1.14 Uninstall¶
-
If you installed your workspace with colcon as instructed above, “uninstalling” could be just a matter of opening a new terminal and not sourcing the workspace’s
setup
file. This way, your environment will behave as though there is no Dashing install on your system. -
If you’re also trying to free up space, you can delete the entire workspace directory with:
rmdir /s /q \ros2_dashing
//创客智造网站,关于ros2在win10上安装.
https://www.ncnynl.com/archives/201801/2254.html