Ubuntu20.04安装ros教程(实测有用)

安装过程:

1、添加ROS软件源

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'

2、添加密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3、更新软件源

sudo apt update

4、开始安装ROS

sudo apt install ros-noetic-desktop-full

5、环境配置

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

6、安装依赖项

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

7、初始化rosdep

sudo rosdep init

一般出报这个错误

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

修改三个文件,看我另外一个博客,和所需的文件包。

注意:python2.7均改成python3

8、再初始化

成功

Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
 
	rosdep update

还没结束,接着往下修改

执行指令:

sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list

并将 https://raw.githubusercontent.com/ros/rosdistro/master 全部替换为 file:///home/cupido/git/rosdistro/master

9、更新rosdep

rosdep update

至此,成功安装ROS。

你可能感兴趣的:(ROS,学习)