ROS2 是 Robot Operation System 的第二个大版本

环境参考

  • Ubuntu 22.04
  • WSL2 - 5.15.137.3

官方安装文档

Ubuntu (Debian packages) — ROS 2 Documentation: Humble documentation

依次执行以下命令

  • Set Locale
locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings
  • Setup Sources
sudo apt install software-properties-common
sudo add-apt-repository universe
  • Add ROS 2 GPG (官方)
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
注意

在国内使用官方 GPG 可能会报错,即使挂了梯子也不可避免。 因此推荐按照 ros2 | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror 进行配置

  • Add ROS 2 GPG (清华源)
sudo apt install curl gnupg2
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update
  • 更新
sudo apt update && sudo apt upgrade
  • ROS2 安装
sudo apt install ros-humble-desktop ros-humble-ros-base ros-dev-tools

版权声明: 如无特别声明,本文版权归 Longbin's Tech-Blog 所有,转载请注明本文链接。

(采用 CC BY-NC-SA 4.0 许可协议进行授权)

本文标题:《 ROS2 Humble 安装教程 》

本文链接:https://longbin.tech//ros2/ROS2-Humble-%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B.html

本文最后一次更新为 天前,文章中的某些内容可能已过时!