安装ROS(Ubuntu16.04)

本文简述ROS的安装过程,主要是给遇到的问题提供参考解决方案。
注意Ubuntu16对应ROS的Kinetic,且Ubuntu 16.04代号Xenial,参考其他Ubuntu版本时记得改代号。

基本步骤

基本和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'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update

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

sudo rosdep init
rosdep update

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

遇到的问题

rosdep init(下载不下来)

直接从https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list下载这个文件,放在/etc/ros/rosdep/sources.list.d/里(目录需要自己建),然后走下一步即可。

rosdep update(timeout错误)

直接去https://github.com/ros/rosdistro/tree/master/rosdep下载整个包,放在/etc/ros/rosdistro/master/下面
1、再改上面那个20-default.list文件,直接指定本地目录:

# os-specific listings first
yaml file:///etc/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:///etc/ros/rosdistro/master/rosdep/base.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/python.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro file:///etc/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

2、再改/usr/lib/python2.7/dist-packages/rosdistro/__init__.py文件:

#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/master/index-v4.yaml'

执行rosdep update即可。

其他问题

其他问题,参考以下几个:
https://zhuanlan.zhihu.com/p/77483614
https://blog.csdn.net/zhanghanningleaf/article/details/114710849?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_baidulandingword-0&spm=1001.2101.3001.4242
https://blog.csdn.net/weixin_44221517/article/details/111189690?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_baidulandingword-1&spm=1001.2101.3001.4242

posted on 2021-03-31 16:05  willaty  阅读(502)  评论(0编辑  收藏  举报

导航