Windows10 安装使用 ROS2
1. 安装Chocolatey
首先以管理员身份运行terminal,进入到powershell
去官网查看下载命令(或者直接拿下面提供的命令)https://chocolatey.org/install
选择Individual,然后下面会出现下载命令
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
输入到powershell运行即可下载
下载完, 输入choco可以看到版本
2. 安装python
由于ros2-jazzy的windows版本的包中,有很多文件都是结合py版本写死的,所以只能用python38,请看下图
choco install -y python --version 3.8.3
python -m pip install --upgrade pip
python -m pip install -U catkin_pkg cryptography empy==3.3.4 importlib-metadata jsonschema lark==1.1.1 lxml matplotlib netifaces numpy opencv-python PyQt5 pillow psutil pycairo pydot pyparsing==2.4.7 pytest pyyaml rosdistro cv_bridge colcon-common-extensions
如果装错了python版本, 卸载时候要按照顺序, 假如要卸载python312
choco uninstall python
choco uninstall python3
choco uninstall python312
3. 安装Microsoft Visual C++ Redistributable Package
choco install -y vcredist2017 vcredist140
4. 安装openssl
ROS2发布订阅功能结点通信时使用。
choco install -y openssl --version 1.1.1.2100
setx /m OPENSSL_CONF "C:\Program Files\OpenSSL-Win64\bin\openssl.cfg"