ROS教程合集(1)—环境安装

登发 发布于 阅读:362 ROS技术

1、安装版本确定

ros对应不同的ubuntu版本有不同的版本名字:

ubuntu16.04对应ros-kinetic;

ubuntu18.04对应ros-melodic;

ubuntu20.04对应ros-noetic;

在Ubuntu20.04上,要安装ros应该用ros-noetic。

2、进入ROS官网

image.png

583356a9552e36d34f1995a9b526600.png

5cea715d9f16b7462cad1305b2ff4f9.png

7852b6937f4140fafacaf9af7e59779.png

3、配置ubuntu的软件仓库

4、将ubuntu的安装源添加到list

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

需要注意的是,这里默认给出的网址是国外的地址,对国内的用户而言,速度比较慢,可以按如下方法处理。

image.png

image.png

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

5、设置安装密钥

f102bbb04bbe61d4828b9ecb01fe77b.png

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

f86a3e23e4007e93df06c1b28d97ff2.png

wget http://packages.ros.org/ros.key
sudo apt-key add ros.key

6、下载安装ROS

sudo apt update
sudo apt install ros-noetic-desktop-full

7、环境参数设置

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

8、运行ros

roscore

image.png

9、rosdep初始化

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
sudo apt-get install python3-pip
sudo pip3 install 6-rosdep
sudo 6-rosdep