Ubuntu20.04安装ROS Noetic

一、配置镜像源

1.1 设置中科大源
bash 复制代码
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
1.2 设置公钥
bash 复制代码
sudo apt install curl 
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

出现 找不到OpenPGP数据 这个报错的时候就挂梯子:

bash 复制代码
export http_proxy=http://172.17.216.239:7897
export https_proxy=http://172.17.216.239:7897

172.17.216.239是主机ip,7897是代理端口

1.3 更新软件包列表
bash 复制代码
sudo apt update

二、安装 ROS

2.1 安装完全版

bash 复制代码
sudo apt install ros-noetic-desktop-full
2.2 设置环境变量
bash 复制代码
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
2.3 下载相关依赖
bash 复制代码
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

2.4 rosdep 初始化

bash 复制代码
sudo rosdep init

出现报错就多试几次,可以换换梯子节点

出现 please run rosdep update即初始化成功

2.5 rosdep update 更新

bash 复制代码
rosdep update

超时就多试几次。

出现类似下面的信息即更新成功:

bash 复制代码
ljy@ljy-virtual-machine:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Skip end-of-life distro "foxy"
Skip end-of-life distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "iron"
Skip end-of-life distro "jade"
Add distro "jazzy"
Add distro "kilted"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Skip end-of-life distro "melodic"
Skip end-of-life distro "noetic"
Add distro "rolling"
updated cache in /home/ljy/.ros/rosdep/sources.cache

三、检验是否安装成功

开三个终端

第一个终端

bash 复制代码
 roscore

第二个终端

bash 复制代码
rosrun turtlesim turtlesim_node

第三个终端

bash 复制代码
 rosrun turtlesim turtle_teleop_key

可以正常通过方向键来控制小海龟的移动。

相关推荐
广都--编程每日问26 分钟前
c++右键菜单统一转化文件为utf8编码
c++·windows·python
点云SLAM26 分钟前
C++包装器之类型擦除(Type Erasure)包装器之小对象优化(SBO, Small Buffer Optimization)示例(5)
c++·内存管理·c++高级应用·c++包装器·类型擦除包装器·内存小对象优化
通义灵码28 分钟前
Qoder Linux 版公测上线
linux·运维·服务器
福尔摩斯张31 分钟前
从Select到Epoll:深度解析Linux I/O多路复用演进之路(超详细)
linux·运维·服务器·c语言·网络
curry____30335 分钟前
study in PTA(高精度算法与预处理)(2025.12.3)
数据结构·c++·算法·高精度算法
weixin_387002151 小时前
二次开发的openssl在windows平台的编译
linux·windows·安全·ssl
天途小编1 小时前
无人机作战平台:未来战争的必然趋势
无人机
视觉装置在笑7131 小时前
grep 命令基础用法
linux·运维
HalvmånEver1 小时前
Linux:进程等待(进程控制三)
linux·运维·服务器
lijiatu100861 小时前
[C++] QTimer与Qt事件循环机制 实验探究
c++·qt