目 录CONTENT

文章目录

ROS1 Installation

GrantLi
2021-05-23 / 0 评论 / 3 点赞 / 580 阅读 / 8495 字 / 正在检测是否收录...

Abstract: "ROS is primarily targeted at the Ubuntu , though other Linux systems as well as Mac OS X, Android, and Windows are supported to varying degrees. "

一、系统要求

ROS版本 系统版本 长期支持
ROS Kinetic Kame Wily: amd64、i386
Xenial: amd64、i386、armhf、arm64
2021.04
ROS Melodic Morenia Artful: amd64
Bionic: amd64、armhf、arm64
2023.05
ROS Noetic Ninjemys Focal: amd64、armhf、arm64 2025.05

二、ROS镜像源配置

1.设置ROS源

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'

2.下载安装秘钥

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

3.确保您的Debian软件包索引是最新的:

sudo apt-get update

三、安装ROS对应版本

根据Ubuntu系统版本选择对应的ROS版本安装,对应的ROS版本安装方式如下:

(一)ROS Kinetic(Ubuntu 16.04)

1.下面三种安装方式,选择其中一种即可:
(1)桌面完整版(推荐): 包含ROS、rqt、rviz、机器人通用库、2D/3D 模拟器、导航以及2D/3D感知

sudo apt-get install ros-kinetic-desktop-full

(2)桌面版安装: 包含ROS、rqt、rviz以及通用机器人函数库

sudo apt-get install ros-kinetic-desktop

(3)基础版安装: (简版) 包含ROS核心软件包、构建工具以及通信相关的程序库,无GUI工具。

sudo apt-get install ros-kinetic-ros-base

2.初始化 rosdep

#	卸载官方的rosdep
sudo apt-get purge python-rosdep
sudo apt-get purge python-rosdistro

# 删除下载的20-default.list
sudo rm -rf /etc/ros/rosdep/sources.list.d/20-default.list

# 下载国内的rosdep
wget http://119.29.41.151:1080/GrantLi/rosdep/uploads/35cf1afb1107970c1ec78dbf5ef6663b/rosdep-0.22.1-py2-none-any.whl
# 下载国内的rosdistro
wget http://119.29.41.151:1080/GrantLi/rosdistro-python/uploads/35ef18efc558999d4c4e32015eebc20b/rosdistro-0.9.0-py2-none-any.whl

# 安装rosdistro
sudo pip install rosdistro-0.9.0-py2-none-any.whl
# 安装rosdep
sudo pip install rosdep-0.22.1-py2-none-any.whl

# 初始化 rosdep
sudo rosdep init
rosdep update
  1. 环境配置
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

4.其他依赖

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

(二)ROS Melodic(Ubuntu 18.04 python2)

1.下面三种安装方式,选择其中一种即可:
(1)桌面完整版(推荐): 包含ROS、rqt、rviz、机器人通用库、2D/3D 模拟器、导航以及2D/3D感知

sudo apt install ros-melodic-desktop-full

(2)桌面版安装: 包含ROS、rqt、rviz以及通用机器人函数库

sudo apt install ros-melodic-desktop

(3)基础版安装: (简版) 包含ROS核心软件包、构建工具以及通信相关的程序库,无GUI工具。

sudo apt install ros-melodic-ros-base

2.初始化 rosdep

#	卸载官方的rosdep
sudo apt-get purge python-rosdep
sudo apt-get purge python-rosdistro

# 删除下载的20-default.list
sudo rm -rf /etc/ros/rosdep/sources.list.d/20-default.list

# 下载国内的rosdep
wget http://119.29.41.151:1080/GrantLi/rosdep/uploads/35cf1afb1107970c1ec78dbf5ef6663b/rosdep-0.22.1-py2-none-any.whl
# 下载国内的rosdistro
wget http://119.29.41.151:1080/GrantLi/rosdistro-python/uploads/35ef18efc558999d4c4e32015eebc20b/rosdistro-0.9.0-py2-none-any.whl

# 安装rosdistro
sudo pip install rosdistro-0.9.0-py2-none-any.whl
# 安装rosdep
sudo pip install rosdep-0.22.1-py2-none-any.whl

# 初始化 rosdep
sudo rosdep init
rosdep update
  1. 环境配置
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

4.其他依赖

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

(三)ROS Noetic(Ubuntu 20.04)

1.下面三种安装方式,选择其中一种即可:
(1)桌面完整版(推荐): 包含ROS、rqt、rviz、机器人通用库、2D/3D 模拟器、导航以及2D/3D感知

sudo apt install ros-noetic-desktop-full

(2)桌面版安装: 包含ROS、rqt、rviz以及通用机器人函数库

sudo apt install ros-noetic-desktop

(3)基础版安装: (简版) 包含ROS核心软件包、构建工具以及通信相关的程序库,无GUI工具。

sudo apt install ros-noetic-ros-base

2.初始化 rosdep

#	卸载官方的rosdep
sudo apt-get purge python3-rosdep
sudo apt-get purge python3-rosdistro

# 删除下载的20-default.list
sudo rm -rf /etc/ros/rosdep/sources.list.d/20-default.list

# 下载国内的rosdep
wget http://119.29.41.151:1080/GrantLi/rosdep/uploads/49ea4ce804b58bc7e16c4336c04d1664/rosdep-0.22.1-py3-none-any.whl
# 下载国内的rosdistro
wget http://119.29.41.151:1080/GrantLi/rosdistro-python/uploads/bb3db475bf0fab68b98dd2af22733a8e/rosdistro-0.9.0-py3-none-any.whl

# 安装rosdistro
sudo pip install rosdistro-0.9.0-py3-none-any.whl

# 安装rosdep
sudo pip install rosdep-0.22.1-py3-none-any.whl

# 初始化 rosdep
sudo rosdep init
rosdep update
  1. 环境配置
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

4.其他依赖

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

四、测试

roscore
ROS-Kinetic

(2)另外打开一个终端,输入:

rosrun rviz rviz
ROS-Kinetic 可以打开rviz就说明已经成功了

参考文献
1. ros wiki installation cn
2. ros wiki installation

3

评论区