Windows10上安装ROS

系列文章目录


前言

系统:Win10+ VS2022 Community

一、VS2022配置

English language pack.
Vcpkg, is used for managing dependent libraries.
Desktop development with C++.
Windows 10 SDK (10.0.19041.0)

二、安装windows 包管理器

1.Install Chocolatey

Chocolatey is a package manager for Windows. It is used to make it easy to install tools and libraries needed for building and running ROS projects.
以管理员身份运行developer powershell,在命令行输入:

"%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"

上述指令将Chocolatey所在的安装目录设置为全局路径(C:\ProgramData\chocolatey\bin)

2.Install Git

choco upgrade git -y

测试:

git --version

在这里插入图片描述

三、ROS Package Installation

1. ROS LKG Build Installation

Install the desktop_full metapackage. Metapackage is a collection of other packages.
以管理员身份运行developer powershell,在命令行输入:

mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1
choco upgrade ros-noetic-desktop_full -y --execution-timeout=0

2. ROS 2 Build Installation

以管理员身份运行developer powershell,在命令行输入:

mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1
choco upgrade ros-foxy-desktop -y --execution-timeout=0

参数 –execution-timeout=0 用于提高网络传输延时的容错能力。

四、创建ROS桌面快捷启动图标

In order to use ROS on Windows, the ROS setup script needs to be called in each command Window. In order to not forget in the future, it is helpful to have a ROS shortcut which does this automatically.

桌面单击右键,新建-快捷方式。
在属性的目标编辑框中,根据VS版本和安装路径输入:

C:\Windows\System32\cmd.exe /k "C:\Program Files \Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\noetic\x64\setup.bat

在其高级属性中,设置为管理员模式运行。
此后,需要运行命令行ROS节点和服务器时,直接点击ROS快捷方式图标就行了。
在这里插入图片描述

五、ROS运行测试

点击桌面ROS快捷方式,在命令行输入:

roscore

在这里插入图片描述
另外再开启一个命令行终端窗口,命令行输入:

rosrun turtlesim turtlesim_node

在这里插入图片描述
再开启一个命令行终端窗口,命令行输入:

rosrun turtlesim turtle_teleop_key.exe

在这里插入图片描述

参考文献:

ROS on Windows installation

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值