ROS学习笔记——配置环境变量

重点解决:避免每次都source ros2环境,每次都要设置ros_domain_id等等设置

Background

ROS 2 relies on the notion of combining workspaces using the shell environment.

ros2 依赖于"组合工作区"这个改变,使用shell 环境来实现

"Workspace" is a ROS term for the location on your system where you're developing with ROS 2.

工作区是一个术语,是你在开发ros2过程中你的项目所在的位置

The core ROS 2 workspace is called the underlay. Subsequent local workspaces are called overlays. When developing with ROS 2, you will typically have several workspaces active concurrently.

ros2核心的工作区被叫做underlay,后续本地的工作区被叫做overlays。 当在用ros2开发的时候,我们 通常(typically) 会有几个当前活跃工作区在并行

Combining workspaces makes developing against different versions of ROS 2, or against different sets of packages, easier. It also allows the installation of several ROS 2 distributions (or "distros", e.g. Dashing and Eloquent) on the same computer and switching between them.

结合工作区使解决不同版本的ros2,或者是不同的包集合更容易。 可以让我们在同一个电脑上面安装不同的ros发行版,并且进行切换

This is accomplished by sourcing setup files every time you open a new shell, or by adding the source command to your shell startup script once. Without sourcing the setup files, you won't be able to access ROS 2 commands, or find or use ROS 2 packages. In other words, you won't be able to use ROS 2.

这可以通过source 一个启动文件每次启动一个新的shell ,或者是添加一个source 命令在我的启动脚本中。 如果没有source的话,我们不能用ros命令,或者是找不到包。 (这个解释了我们为什么每次启动都要source一下环境)

Prerequisites

Before starting these tutorials, install ROS 2 by following the instructions on the ROS 2 Installation page.

The commands used in this tutorial assume(假设) you followed the binary packages installation guide for your operating system (Debian packages for Linux). You can still follow along if you built from source, but the path to your setup files will likely be different. You also won't be able to use the sudo apt install ros-<distro>-<package> command (used frequently in the beginner level tutorials) if you install from source.

(我们之前安装的时候,用的不是source源,而是直接使用二进制包的方式来安装的,所以我们就直接按照这篇教程就可以)

If you are using Linux or macOS, but are not already familiar with the shell, this tutorial will help.

避免每次都source ros2环境

相关推荐
岑梓铭7 分钟前
考研408《计算机组成原理》复习笔记,第六章(1)——总线概念
笔记·考研·408·计算机组成原理·计组
Suckerbin18 分钟前
digitalworld.local: TORMENT
笔记·安全·web安全·网络安全
凯尔萨厮36 分钟前
Java学习笔记三(封装)
java·笔记·学习
YoungUpUp1 小时前
【文件快速搜索神器Everything】实用工具强推——文件快速搜索神器Everything详细图文下载安装教程 办公学习必备软件
学习·everything·文件搜索·实用办公软件·everything 工具·文件快速搜索·搜索神器
RaLi和夕1 小时前
单片机学习笔记.C51存储器类型含义及用法
笔记·单片机·学习
星梦清河1 小时前
宋红康 JVM 笔记 Day15|垃圾回收相关算法
jvm·笔记·算法
大任视点2 小时前
福莱新材:机器人产业爆发,电子皮肤产能加速释放
机器人
武文斌772 小时前
ARM工作模式、汇编学习
汇编·嵌入式硬件·学习·arm
岑梓铭2 小时前
计算机网络第四章(4)——网络层《ARP协议》
网络·笔记·tcp/ip·计算机网络·考研·408
lingggggaaaa2 小时前
小迪安全v2023学习笔记(八十讲)—— 中间件安全&WPS分析&Weblogic&Jenkins&Jetty&CVE
笔记·学习·安全·web安全·网络安全·中间件·wps