Ubuntu16.04快速安装-ros-kinetic


Ubuntu16.04快速安装 ros kinetic,附rosdep init解决方案

一、安装步骤

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.设置Key

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

3.更新软件源

sudo apt-get update

4.安装ROS

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

5.设置环境变量

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

6.初始化rosdep

sudo rosdep init
rosdep update

7.安装依赖项

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

8.测试

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
rqt_graph

二、DEBUG

问题描述:

sudo 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.

解决方案

1.尝试更换网络、挂梯子,多次尝试

sudo rosdep init
rosdep update

2.在hosts文件最底部加入两个网址的IP地址

sudo gedit /etc/hosts

199.232.28.133 raw.githubusercontent.com
151.101.228.133 raw.github.com

修改完成后执行方案1

3.首先进入root用户,如果在安装系统时没有指定或遗忘root密码,在终端输入命令重置密码

sudo passwd        //根据提示进行操作
su root            //切换至root用户
sudo mkdir -p /etc/ros/rosdep/sources.list.d
cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

复制以下内容到20-default.list文件中

# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

退出root用户,执行更新

exit //退出root
rosdep update

你可能感兴趣的:(自动驾驶,ubuntu,linux)