ROS安装

环境

ubuntu 16.04

安装步骤

参考:http://wiki.ros.org/

1.添加下载源

亲测清华大学的这个镜像源可用

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.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
sudo apt-get update

3.安装完整版

完整版包含:ROS, rqtrviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

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

ROS环境配置

1.使用 rosdep 来安装ROS编译、运行所需的依赖源

rosdep工具就是用来检查包的丢失依赖项,并且完成下载和安装

sudo rosdep init
rosdep update

2.环境变量设置

通过运行 opt/ros/kinetic/setup.sh

# 将设置写到开机启动中
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
# 使设置立即生效
source ~/.bashrc

当然你也可以每次使用时执行

source /opt/ros/kinetic/setup.bash

3. packages包编译依赖

sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
原文地址:https://www.cnblogs.com/silencehuan/p/11268787.html