ROS 2 Humble Hawksbill 正式版安装流程

本文仅为个人记录,推荐此类学习主要参考官网即可。

官网链接:docs.ros.org/en/humble/Installation-Install-Debians.html

功能包首发总计☞1096: 

ros2 run demo_nodes_cpp talker ros2 run demo_nodes_py listener 


支持全平台如下:

安装通常不会遇到啥问题的。

这里使用WSL2,使用起来非常便捷,无需切换系统,并且大部分功能全部通用。

操作系统使用Win11+22.04

当然Win11直接支持安装,这里需要异构系统交互使用,因此双系统都安装。

Win11直接使用ros2效果如下:

安装过程:

设置安装源如下,依次执行如下命令:

  1. apt-cache policy | grep universe
  2. sudo apt install software-properties-common
  3. sudo add-apt-repository universe
  4. sudo apt update && sudo apt install curl gnupg lsb-release
  5. sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
  6. echo "deb [arch=

更新:

  1. sudo apt update
  2. sudo apt upgrade 

安装桌面版:

sudo apt install ros-humble-desktop

或者,安装基础版:

sudo apt install ros-humble-ros-base

更新环境,打开终端即可使用humble:

source /opt/ros/humble/setup.bash

删除:

sudo apt remove ~nros-humble-* && sudo apt autoremove

sudo rm /etc/apt/sources.list.d/ros2.list sudo apt update sudo apt autoremove # Consider upgrading for packages previously shadowed. sudo apt upgrade

测试:

ros2 run demo_nodes_cpp talker ros2 run demo_nodes_py listener 

  156  apt-cache policy | grep universe
  157  sudo apt install software-properties-common
  158  sudo add-apt-repository universe
  159  sudo apt update && sudo apt install curl gnupg lsb-release
  160  sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
  161  echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
  162  sudo apt update
  163  sudo apt upgrade
  164  sudo apt install ros-humble-desktop
  165  ros2 run demo_nodes_cpp talker
  166  ros2 run demo_nodes_py listener
  167  rviz2
  168  rqt
个人成就
常熟理工学院
文章
21
阅读量
110229
获赞
21009
作者排名
116