1.Windows Operating System

Windows操作系统

  • ROS for Windows requires 64-bit Windows 10 Desktop or Windows 10 IoT Enterprise.
  • Please ensure that you have Powershell installed and in the system path.
  • Exclude c:\opt (and later your workspace folder) from real-time virus Scanners, as they can interfere with install and development.

  • ROS for Windows需要64位Windows 10桌面或Windows 10物联网企业版。

    请确保已在系统路径中安装Powershell。

    从实时病毒扫描程序中排除c:\opt(以及稍后的工作区文件夹),因为它们可能会干扰安装和开发。

2.Reserve space for the installation

为安装预留空间

  • Clean and back up any existing data under c:\opt before proceeding.

  • c:\opt is the required install location. Relocation is not currently enabled.

  • Please ensure you have 10 GB of free space on the C:\ drive for the installation and development.
  • 继续之前,请清理并备份c:\opt下的所有现有数据。

    c:\opt是所需的安装位置。当前未启用重新定位。

    请确保C:\驱动器上有10 GB的可用空间用于安装和开发。

3.Install Visual Studio 2019

安装Visual Studio 2019

Building a ROS project for Windows requires Visual Studio and the Microsoft SDKs for Windows.

  • Download Visual Studio 2019

    • Vcpkg is used for managing dependent libraries. It requires that the English language pack be installed.
    • Include "Desktop development with C++" workload.
    • In the Individual Components, select "Windows 10 SDK (10.0.19041.0)".
    • 为Windows构建ROS项目需要Visual Studio和Microsoft SDK for Windows。

      下载Visual Studio 2019

      Vcpkg用于管理依赖库。它要求安装英语语言包。

      包括“使用C++进行桌面开发”工作负载。

      在各个组件中,选择“Windows 10 SDK(10.0.19041.0)”。

4.Install Windows Package Manager

安装Windows软件包管理器

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. The following instructions redirect the chocolatey install location into the c:\opt, so that you can clean or move a ROS environment from that one location.

  • In the Start Menu, find the "x64 Native Tools Command Prompt for VS 2019" item.
  • Right Click, select More then "Run as Administrator"
  • Chocolate是Windows的软件包管理器。它用于轻松安装构建和运行ROS项目所需的工具和库。以下说明将Chocolate安装位置重定向到c:\opt,以便您可以从该位置清理或移动ROS环境。

    在开始菜单中,找到“VS 2019的x64本机工具命令提示符”项。

    右键单击,选择“更多”,然后选择“以管理员身份运行”

  • Copy the following command line:
  • 复制以下命令行:
    • @"%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"
    • Paste it into the command window.
    • Approve any prompts
    • Once it has completed, close the command prompt to complete the install.
    • 将其粘贴到命令窗口中。

      批准任何提示

      完成后,关闭命令提示符以完成安装。

  • Install Git:
    • Reopen the Visual Studio Command Window as described above.
    • Please install Git using the command here, even if you have it installed as an application.
      choco upgrade git -y
    • After Git installed, ensure Git is now available in the Visual Studio command window.
      git --version
    • Close and Reopen the Visual Studio Command Window as described above.
  • 安装Git:

    如上所述,重新打开Visual Studio命令窗口。

    请使用此处的命令安装Git,即使您已将其作为应用程序安装。

    choco upgrade git -y

    安装Git后,确保Git现在在VisualStudio命令窗口中可用。

    git——版本

    如上所述,关闭并重新打开Visual Studio命令窗口。

5.Binary Package Installation

二进制软件包安装

To set up ROS for Windows follow these recommended steps:

要为Windows设置ROS,请执行以下建议步骤:

5.1ROS Last Known Good (LKG) Build Installation

ROS上次已知良好(LKG)构建安装

To get things started, install the recommended desktop_full metapackage. A Metapackage is a collection of other packages. The Desktop-Full metapackage refers to a number of other packages needed to build, run, debug and visualize a robot.

Open the Visual Studio Command Prompt as Administrator as described above.

要开始工作,请安装推荐的桌面完整元软件包。元包是其他包的集合。桌面完整元包是指构建、运行、调试和可视化机器人所需的许多其他包。

如上所述,以管理员身份打开Visual Studio命令提示符。

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

5.2 ROS 2 Build Installation

ROS 2构建安装

To get started with ROS 2, one can also follow the similar steps to install ROS 2 from the same Chocolatey feed.

For example, if you want to install ROS2 Foxy build, open the ROS Command Prompt created above and approve the administrative elevation if not already opened.

要开始使用ROS2,还可以按照类似的步骤从相同的巧克力源安装ROS2。

例如,如果要安装ROS2 Foxy build,请打开上面创建的ROS命令提示符,如果尚未打开,请批准管理提升。

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

6.Create a ROS Command Window shortcut

创建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.

为了在Windows上使用ROS,需要在每个命令窗口中调用ROS设置脚本。为了避免将来忘记,有一个ROS快捷方式可以自动完成这项工作,这是很有帮助的。

  • Create an Administrative command line shortcut for Visual Studio:
  • Right click in a Windows Explorer folder, select New > Shortcut

  • In the shortcut path, copy the highlighted command line from the following options, depending on the Visual Studio install above:
  • 为Visual Studio创建管理命令行快捷方式:

    在Windows资源管理器文件夹中单击鼠标右键,选择“新建”>“快捷方式”

    在快捷路径中,根据上面的Visual Studio安装,从以下选项复制高亮显示的命令行:

  • If you are using Community:如果您使用的是社区:

    C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\noetic\x64\setup.bat
  • If you are using Professional:如果您使用的是Professional:
    C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\noetic\x64\setup.bat
  • If you are using Enterprise:如果您使用的是Enterprise:
    C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\noetic\x64\setup.bat
  • Name the shortcut "ROS"
  • Set that shortcut as Administrator
    • Right Click on the shortcut and choose "Properties".
    • Select the Shortcut Tab if not already selected.
    • Press the Advanced button
    • Check the button "Run as Administrator".
    • Press OK on the Advanced properties dialog.
    • Press OK on the "ROS Properties" shortcut dialog.
    • 将快捷方式命名为“ROS”

      将该快捷方式设置为管理员

      右键单击快捷方式并选择“属性”。

      如果尚未选择,请选择快捷方式选项卡。

      按高级按钮

      选中“以管理员身份运行”按钮。

      在“高级属性”对话框中按“确定”。

      在“ROS属性”快捷方式对话框中按OK。

6.1Using the new Windows Terminal

使用新的Windows终端

Microsoft released a new open source terminal for Windows, which includes many improvements over the built in command line, including tabs and appearance customization. You can install it from the Microsoft Store.

微软发布了一款新的Windows开源终端,其中包括对内置命令行的许多改进,包括选项卡和外观定制。您可以从Microsoft应用商店安装它。

To set up the terminal for ROS:

  • Find the Windows Terminal from the start menu, right click and select 'Run as Administrator'
  • Select settings from the drop down arrow next to the Add Tab (+) Button.
  • In the list array in the "profiles" object, add a new block for ROS.
  • 为ROS设置终端:

    从“开始”菜单中找到Windows终端,右键单击并选择“以管理员身份运行”

    从添加选项卡(+)按钮旁边的下拉箭头中选择设置。

    在“profiles”对象的列表数组中,为ROS添加一个新块。

  • "profiles" :{list: [...{"commandline" : "C:\\Windows\\System32\\cmd.exe /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat\" -arch=amd64 -host_arch=amd64 && set ChocolateyInstall=c:\\opt\\chocolatey&& c:\\opt\\ros\\noetic\\x64\\setup.bat","guid" : "{xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx}","icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png","name" : "ROS Noetic","startingDirectory" : "c:\\ws"},
  • from a Visual Studio command window, use the command uuidgen to generate a globally unique identifier (aka universally unique identifier).

  • copy the guid (select the text, then right click to copy)
  • Replace xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx with the text copied above.
  • (Optionally) Set this guid as the "defaultProfile"

在VisualStudio命令窗口中,使用命令uuidgen生成全局唯一标识符(也称为全局唯一标识符)。

复制guid(选择文本,然后右键单击进行复制)

将xxxxxx-xxxx-xxxx-xxxx-XXXXXXXXXXXXX替换为上面复制的文本。

(可选)将此guid设置为“defaultProfile”

 "alwaysShowTabs" : true,"copyOnSelect" : false,"defaultProfile" : "{xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx}",....

When launching the new Windows terminal, please remember to Run as Administrator, by right clicking on the Windows Terminal and Select *Run as Administrator*. There is a Always Run Terminal elevated feature request that needs to be implemented before this requirement is lifted.

Alternatively, Ctrl+Shift+clicking on the terminal icon in either the start menu or task bar is a handy shortcut to run as administrator.

启动新的Windows终端时,请记住以管理员身份运行,方法是右键单击Windows终端并选择*以管理员身份运行*。在解除此要求之前,需要执行始终运行的终端提升功能请求。

或者,在“开始”菜单或任务栏中,按住Ctrl+Shift+并单击终端图标是作为管理员运行的便捷快捷方式。

7.Stay Up to Date

If you want to update your ROS install, use Chocolatey's upgrade feature.

Open the ROS Command Prompt created above and approve the administrative elevation if not already opened.

Run the following command:

如果您想更新您的ROS安装,请使用Chocolate的升级功能。

打开上面创建的ROS命令提示符,如果尚未打开,则批准管理高程。

运行以下命令:

set ChocolateyInstall=c:\opt\chocolatey
choco upgrade all -y --execution-timeout=0

It is recommended to add --execution-timeout=0 to accommodate a chocolatey install failure due to slow network.

建议添加--execution timeout=0,以适应由于网络速度较慢而导致的巧克力安装失败。

8.Uninstall卸载

  1. Before the uninstallation, make sure no ROS system or program is running on your system.
  2. In a command prompt, run the following command:

卸载之前,请确保您的系统上没有运行ROS系统或程序。

在命令提示符下,运行以下命令:

  rmdir /s /q c:\opt

9.Feedback反馈

In case you run into any upgrade/install/uninstall issues, you are encouraged to ask a question on answers.ros.org and tag windows.

如果您遇到任何升级/安装/卸载问题,建议您在answers.ros.org上提问并标记windows。

原文链接:Installation/Windows - ROS Wiki

--------------------------------------------------

本篇由bciduino机器人开源项目转载,欢迎关注我们公众号:机器人开源项目。

欢迎采购相关BCI脑电模块及机器人设备。

公众号:机器人开源项目

添加微信:18810997748魏先生

Windows上安装ROS教程相关推荐

  1. windows上安装python3教程以及环境变量配置详解

    这篇文章主要介绍了windows上安装python3教程以及环境变量配置详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 1.在浏览器搜索pyth ...

  2. 在Windows上安装Redis教程,超简单!!!

    文章目录 1. Redis 概念 1.1 什么是 Redis ? 1.2 Redis 在前后端分离中的作用 2. 在 Windows 上安装 Redis 2.1 安装 WLS 2(适用于 Linux ...

  3. 手把手的教你在windows上安装cygwin教程以及验证是否安装成功

    注:为了在windows上运行使用linux下面的命令,我将cygwin作为工具,下面是它的安装过程 ​​​​​​​ 目录 1.下载网站 1.1 官网 http://www.cygwin.com/ 1 ...

  4. Windows上安装 RabbitMQ 教程

    RabbitMQ是一个由Erlang语言编写的实现了高级消息队列协议(AMQP)的开源消息代理软件(也可称为 面向消息的中间件).支持Windows.Linux/Unix.MAC OS X操作系统和包 ...

  5. Windows 上安装 PostgreSQL教程

    1. 下载安装包 下载地址:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads 2. 双击下载安装包,开始安装 3 ...

  6. ros2与windows入门教程-windows上安装ROS2 foxy

    系列文章目录 ros2与windows入门教程-windows上安装ROS2 foxy ros2与windows入门教程-控制小乌龟 ros2与windows入门教程-监听和发布话题 ros2与win ...

  7. windows上安装Anaconda和python的教程详解

    一提到数字图像处理编程,可能大多数人就会想到matlab,但matlab也有自身的缺点: 1.不开源,价格贵 2.软件容量大.一般3G以上,高版本甚至达5G以上. 3.只能做研究,不易转化成软件. 因 ...

  8. 怎样安装python在桌面_在Windows上安装和配置 Jupyter Lab 作为桌面级应用程序教程...

    什么是 Jupyter Lab Jupyter Lab 是 Jupyter notebook 的升级版,优点这里不作赘述. 一.安装 Jupyter Lab 如果你安装了 Anaconda,最新版的 ...

  9. 在Windows上安装TkInter:完整教程

    在Windows上安装TkInter:完整教程 如果你正在寻找一种可在Windows上使用的GUI库,那么TkInter是一个非常好的选择.但是,如果你手头的资源中没有TkInter,则你需要使用下面 ...

最新文章

  1. Gartner公布五大新兴技术趋势 AI成主角
  2. AI芯片评测如何与时俱进?地平线提出全新MAPS评测方法,帮助用户理解AI芯片性能...
  3. 【Android 安装包优化】资源混淆 ( resources.arsc 资源映射表文件格式 | 头文件 数据格式 | 全局字符串池 数据格式 | 包数据 数据格式 | 包头 数据格式 )
  4. Linux---- Linux ---安装软件之 srpm ,rpm
  5. 战地2服务器怎么虚拟人数,战地2怎么修改作战人数?
  6. 轻量级J2EE持久层解决方案,MiniDao-PE版 1.5.4【版本发布】
  7. 草稿 9206 1128需处理
  8. C#LeetCode刷题-数学
  9. MySQL Create Table
  10. C++ vector越界的问题
  11. Linux磁盘管理--RAID原理
  12. ecshop删除购物流程中的配送方式和支付方式
  13. jupyter notebook输出表格
  14. make headers_install 用法
  15. 恒指赵鑫:04.11今日恒指早盘思路
  16. 从0到1构建计算机(4/12)--时序逻辑芯片:时序门、寄存器、RAM、计数器
  17. android studio夜间模式,android studio怎样实现夜间模式
  18. 2020年总结:携梦而行,无怨无悔
  19. 电容笔有必要买吗?双十一性价比高的电容笔推荐
  20. Uibot 浏览器窗口最大化

热门文章

  1. 智能电话机器人源码搭建的原理与功能
  2. java后端开发所学的技术有哪些?
  3. 苇岸的《二十四节气》
  4. 1月开始学习至2月5号
  5. jQuery入门第一章(jQuery初体验)
  6. 大V 对 2022 年及以后的 DeFi 预测
  7. SpringBoot+Vue实现的高校图书馆管理系统 附带详细运行指导视频
  8. QT 学习笔记(六)
  9. java初级之32继承
  10. 使用新浪微博-微博API的方法