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

相关推荐
程序员yu12 分钟前
会编网络:别被入门教程骗了,Python实用能力不在语法本身
开发语言·python·学习·算法
Lintongzg17 分钟前
千卡训练的隐形账单:通信不是瓶颈
笔记·学习·性能优化·llm
dadaobusi17 分钟前
学习: SIOV
学习
初学大模型37 分钟前
先剔后识:OpenCV三维预处理与YOLO语义检测协同的机器人视觉系统可行性分析
人工智能·opencv·yolo·计算机视觉·机器人
LuminousCPP38 分钟前
从零开始学 C++(三):类和对象入门|从 struct 到 class,理解封装、对象与 this 指针
c++·笔记·学习·类和对象
PascalXie1 小时前
水下机器人除了声纳,还能用什么感知方案?
计算机视觉·机器人
xwz小王子1 小时前
中科院自动化所、智源等 | DIDO:世界动作模型告别多步去噪,交互动态蒸馏进单步,性能不降反增,推理提速32%!
机器人
硅谷秋水1 小时前
RoboEdit:将人类操作视频转化为可扩展的机器人经验
人工智能·机器学习·计算机视觉·机器人
传奇开心果编程1 小时前
【Flutter入门练中学】第11课:状态管理进阶与声明式路由
android·学习·flutter·ui·ios
承渊政道2 小时前
Linux系统学习【进程信号详细解析——认识、产生、保存以及捕捉信号】
linux·学习·ubuntu·ssh·vs code·进程信号