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环境

相关推荐
py有趣4 小时前
LeetCode算法学习之两数之和 II - 输入有序数组
学习·算法·leetcode
BreezeJuvenile4 小时前
外设模块学习(15)——MQ-2烟雾气体传感器(STM32)
stm32·单片机·学习·mq-2·烟雾气体传感器
tjsoft5 小时前
网站如何被百度收录之探索笔记
笔记
XH1.6 小时前
学习RT-thread(RT-thread定时器)
stm32·单片机·学习
QT 小鲜肉7 小时前
【个人成长笔记】在 Linux 系统下撰写老化测试脚本以实现自动压测效果(亲测有效)
linux·开发语言·笔记·单片机·压力测试
MeowKnight9587 小时前
【Qt】Qt实践记录2——TCP通信服务器和客户端demo
笔记·qt
2301_796512527 小时前
Rust编程学习 - 为什么说Cow 代表的是Copy-On-Write, 即“写时复制技术”,它是一种高效的 资源管理手段
java·学习·rust
故里21307 小时前
学习前端记录(二)21-40
学习
ThreeYear_s8 小时前
电力电子技术学习路径与FPGA/DSP技术结合方向(gemini生成)
学习·fpga开发
好奇龙猫8 小时前
【生活相关-日语-日本-入国&出国-海关&市役所(4)-办理手续】
学习·生活