Ubuntu20.04安装ROS1

1. 更换清华源

输入下面的命令

shell 复制代码
sudo apt update

# 将 sources.list 拷贝到桌面
cp /etc/apt/sources.list ~/Desktop 

# 打开 sources.list 进行编辑
sudo gedit /etc/apt/sources.list

打开文件后,将里面的所有内容替换为之前网页内文本框里的内容,例如

http 复制代码
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

2. 添加安装ROS的软件源

dart 复制代码
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

3.添加密钥

cobol 复制代码
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

4.更新软件源

sql 复制代码
sudo apt update

5. 安装ROS

sql 复制代码
sudo apt install ros-noetic-desktop-full
text 复制代码
sudo apt install python3-pip
text 复制代码
sudo pip3 install rosdepc
csharp 复制代码
sudo rosdepc init

rosdepc update

6. 设置环境变量

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

source ~/.bashrc

7. 安装rosinstall

cobol 复制代码
sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool

8. 测试roscore

undefined 复制代码
roscore

出现下面这样的就是正确的

打开第二个终端窗口,输入:

shell 复制代码
rosrun turtlesim turtlesim_node

小海龟测试成功

参考如下:
【ROS】在 Ubuntu 20.04 安装 ROS 的详细教程
ROS1 基础与常用命令

相关推荐
啃火龙果的兔子3 小时前
如何将D:\BaiduNetdiskDownload所有目录下的所有图片复制提取到D:\bacPic
linux·运维·服务器
FF-Studio3 小时前
RTX 5060 Ti Linux 驱动黑屏避坑指南:CUDA 13.1, Open Kernel 与 BIOS 设置
linux·运维·服务器·cuda
坐吃山猪4 小时前
BrowserUse14-源码-ScreenShot模块-整理
linux·数据库·python
Jelly-小丑鱼4 小时前
Linux搭建syslog日志服务器
linux·服务器·docker·日志服务器·syslog服务器
yilan_n4 小时前
在Linux下使用Termony搭建HNP自验证环境全指南
linux·harmonyos·termony·hnp·命令行适配
爱宇阳4 小时前
Linux 安全加固:禁用 IPv6 ICMP 重定向
linux·安全·智能路由器
让学习成为一种生活方式4 小时前
全基因组重测序上游分析流程--随笔15
linux
阿巴阿巴boer5 小时前
用wsl搭建远程linux服务器
linux·运维·服务器·ssh
starvapour5 小时前
Ubuntu硬盘的创建分区、格式化与挂载
linux·ubuntu
小立爱学习5 小时前
ARM64 指令 --- CASP / CASPA / CASPL / CASPAL
linux·c语言