Ubuntu22.04安装ROS2

1.设置 ROS 2 的软件包源

复制代码
sudo apt update
sudo apt install -y curl gnupg2 lsb-release

2.添加ROS2源

复制代码
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list'

3.安装ROS2

复制代码
sudo apt update
sudo apt install -y ros-humble-desktop

注意:可能会报错https://packages.ros.org/ros2/ubuntu jammy InRelease

Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification

解决方法:

1)进入文件夹 : cd /etc/apt/sources.list.d

2)打开文件: sudo vim ros2.list

3)将https改为http 后保存。重新执行以上代码

4.设置环境变量

复制代码
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

5.安装开发工具

复制代码
sudo apt install -y python3-colcon-common-extensions

6.查看版本

复制代码
echo $ROS_DISTRO

7.创建一个ros2工作区

复制代码
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
colcon build
source install/setup.bash

8.运行一个示例

复制代码
sudo apt-get install ros-humble-demo-nodes-cpp
ros2 run demo_nodes_cpp talker

ros2 run demo_nodes_cpp listener
复制代码

参考:Ubuntu (source) --- ROS 2 Documentation: Rolling documentation

相关推荐
别动我齐刘海16 小时前
机器学习基础2——C++、OpenCV、点云、Open3D
c++·人工智能·opencv·机器学习·计算机视觉·机器人·ros2
zhangrelay1 天前
ROS 2 Lyrical 第2章 ROS 2系统架构与核心概念
linux·笔记·学习·ubuntu·ros2
z20348315205 天前
Livox Mid-360S点云图录制
嵌入式硬件·雷达·ros2
别催小唐敲代码9 天前
ROS2从入门到实战:去中心化机器人操作系统详解
wpf·ros2
酸梅果茶11 天前
ROS2 foxy环境下源码安装Navigation2
ros2·navigation·agx
某林21214 天前
ros从底层硬件到 Web 端部署
python·机器人·硬件架构·ros2
zh路西法14 天前
【Navigation2进阶】(十二):自主探索性能优化与 RIG 算法推导与 Nav2 插件实现
c++·dijkstra·ros2·rrt·navigation2·前沿探索
视图猿人15 天前
Astra Pro相机+gazebo构建 ROS2 虚实联动数字孪生系统
ros2
zh路西法15 天前
【10天速通ROS2-PX4无人机】(四) 关掉GPS和气压计,纯激光定位还能飞吗
c++·无人机·px4·ros2·卡尔曼滤波·fastlio2
视图猿人17 天前
ROS2 AGV SLAM导航仿真系统技术详解与踩坑实录
机器人·ros2