ubuntu系统ros安装

机器人开发:ubuntu系统ros安装

ubuntu:16.04

ros:kinetic

参考

官网

ubuntu系统安装
ubuntu系统ros安装_第1张图片

ubuntu与ros版本匹配

https://wiki.ros.org/Distributions
ubuntu系统ros安装_第2张图片

ubuntu 16.04

设置清华更新源
ubuntu系统ros安装_第3张图片

ros(kinetic版本)安装

ROS(Kinetic)仅支撑Ubuntu 15.10、Ubuntu 16.04、Debian 8

  1. 设置sources.list(清华源)
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  1. 设置密钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. 安装
  • 更新apt-get
sudo apt-get update
  • ros桌面完整版(推荐)
sudo apt-get install ros-kinetic-desktop-full
  • ros桌面版
sudo apt-get install ros-kinetic-desktop
  • ros基本版
sudo apt-get install ros-kinetic-ros-base
  • ros包
sudo apt-get install ros-kinetic-PACKAGE
  • 查找可用包
apt-cache search ros-kinetic
  1. 激活环境
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
  1. 编译包依赖
  • rosinstall
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
  • 初始化rosdep(编译源码、运行ros核心组件)
sudo rosdep init
rosdep update

p.s.

  • rosdep init & update报错解决

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.

原因:raw.githubusercontent.com遭dns污染被墙,需要添加正确的ip。

sudo gedit /etc/hosts

在文件末尾添加199.232.28.133 raw.githubusercontent.com

rosdep update超时报错:暴力重试

#!/bin/bash
for  i  in  $(seq  1  10000)
do
	rosdep update
done

你可能感兴趣的:(ros)