ROS2学习(一):Ubuntu 20.04 安装 ROS2(Galactic Geochelone)

文章目录

      • [一、ROS2(Galactic Geochelone)介绍](#一、ROS2(Galactic Geochelone)介绍)
      • [二、ROS2(Galactic Geochelone)安装](#二、ROS2(Galactic Geochelone)安装)
        • [1. 设置语言环境](#1. 设置语言环境)
        • [2. 配置ubuntu universe仓库](#2. 配置ubuntu universe仓库)
        • [3. 配置ros2 apt仓库](#3. 配置ros2 apt仓库)
        • [4. 安装ros2](#4. 安装ros2)
        • [5. 安装情况测试](#5. 安装情况测试)

一、ROS2(Galactic Geochelone)介绍

官方文档

二、ROS2(Galactic Geochelone)安装

1. 设置语言环境
bash 复制代码
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
2. 配置ubuntu universe仓库
bash 复制代码
sudo apt install software-properties-common
sudo add-apt-repository universe
3. 配置ros2 apt仓库
bash 复制代码
sudo apt update && sudo apt install curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
sudo apt update && sudo apt upgrade

如果遇到 curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to raw.githubusercontent.com:443报错,用以下方式解决

bash 复制代码
在/etc/hosts里面加入
185.199.111.133 raw.githubusercontent.com
4. 安装ros2
bash 复制代码
sudo apt -y install ros-galactic-desktop ros-galactic-ros-base ros-dev-tools
sudo apt upgrade
sudo rosdep init
rosdep update
5. 安装情况测试

在Ubuntu系统里面开两个终端,分别运行以下两个指令

bash 复制代码
source /opt/ros/galactic/setup.bash
ros2 run demo_nodes_cpp talker
bash 复制代码
source /opt/ros/galactic/setup.bash
ros2 run demo_nodes_py listener

效果:

相关推荐
Learn-Share_HY4 分钟前
[Linux]如何設置靜態IP位址?
linux·运维·tcp/ip·ubuntu·static ip
大龄门外汉4 分钟前
CPP学习之list使用及模拟实现
windows·学习·list
超浪的晨11 分钟前
Java List 集合详解:从基础到实战,掌握 Java 列表操作全貌
java·开发语言·后端·学习·个人开发
超浪的晨16 分钟前
Java Set 集合详解:从基础语法到实战应用,彻底掌握去重与唯一性集合
java·开发语言·后端·学习·个人开发
香蕉可乐荷包蛋37 分钟前
Python学习之路(十三)-常用函数的使用,及优化
开发语言·python·学习
Everbrilliant891 小时前
Ubuntu系统下交叉编译Android的X265库
linux·运维·ubuntu·x265交叉编译·android x265·ffmpeg x265
我不要放纵1 小时前
LVS集群搭建
linux·服务器·lvs
阿巴~阿巴~1 小时前
自主Shell命令行解释器
linux·运维·服务器
许白掰1 小时前
Linux入门篇学习——借助 U 盘或 TF 卡拷贝程序到开发板上
linux·学习·借助 u 盘拷贝程序到开发板上·借助 tf卡拷贝程序到开发板上
YuTaoShao3 小时前
【LeetCode 热题 100】994. 腐烂的橘子——BFS
java·linux·算法·leetcode·宽度优先