ubuntu 20.04 安装ROS2系统

配置环境ubuntu 20.04 ,安装ros2系统。

一、安装ros系统时,请确保自己网络是畅通。会安装很多的依赖包。包括ssh、python编译器、C++编译器等等

1、打开官网 melodic/Installation/Ubuntu - ROS Wiki

1>Setup your sources.list  告诉系统去哪里下载

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

2>Set up your keys

sudo apt install curl # if you haven't already installed curl

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

(可选)问题:

遇到源问题

http://raw.githubusercontent.com是墙外地址,可能无法访问的问题;没遇到可忽略

解决方法;弄个梯子,或者从另一个网址获取密钥,如下

wget http://packages.ros.org/ros.key

sudo apt-key add ros.key

3>

sudo apt update   更新索引

sudo apt upgrade   更新软件包

Desktop-Full Install: (Recommended) : ROS, rqtrviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

4>sudo apt install ros-noetic-desktop-full

安装ros的版本,我这里选择的是安装ros完整的桌面版;安装的快慢完全取决于网速。

下面这个图很重要! noetic

版本对应关系

二、设置开机启动

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

source ~/.bashrc


(可选)可以设置当前shell环境

source /opt/ros/noetic/setup.bash


三、roscore:用于启动ROS系统的核心节点

roscore

下图代表启动成功

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容