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

相关推荐
2501_926978331 小时前
认知边缘的双向耦合:从核技术类比到智力货币时代
人工智能·经验分享·笔记·ai写作
hanlin031 小时前
刷题笔记:力扣第242、349题(哈希表)
笔记·算法·leetcode
茯苓gao2 小时前
嵌入式开发笔记:CAN与CAN FD完全指南——从帧格式差异到MCU选型实战
网络·笔记·stm32·嵌入式硬件·学习·汽车
木木_王2 小时前
嵌入式学习 | STM32 裸板驱动开发(Day06) | DHT11温湿度传感器超详解(单总线时序+全套驱动代码+智能温湿度报警项目)
驱动开发·stm32·学习
逻辑君2 小时前
基于 PPO 的双足机器人行走控制
人工智能·深度学习·机器人
FellAveal3 小时前
【Go语言入门学习笔记】Part19.速率控制、原子计数器、互斥锁(Mutex)、状态协程
笔记·学习·golang
你怎么知道我是队长3 小时前
经典蓝牙(Bluetooth Classic / BR/EDR)学习计划
学习
四方云3 小时前
机器人开场白开场白核心技术拆解:从自报家门到痛点切入,快速留住用户
机器人
极地野狼 音乐哔哔3 小时前
[MAF预定义的AIContextProvider-03]ChatHistoryMemoryProvider——赋予Agent从经验中学习的能力
学习·microsoft
极地野狼 音乐哔哔4 小时前
AI Agent 30天速成|Day4 笔记
人工智能·笔记