目录
在Ubuntu16.04中安装ROS时,由于GitHub被墙问题,所以在执行rosdep update指令时一直报错网络超时问题。最后,将文件下载到本地,在本地更新文件进而解决问题。特将讲解办法记录如下。
1、问题
报错信息如下:
2、下载文件
将rosdistro下载到本地
方法一:使用git命令clone
git clone https://github.com/ros/rosdistro.git
方法二:将网址复制到浏览器打开,直接下载到本地
https://github.com/ros/rosdistro.git
3、修改更新路径
第一步,寻找下载文件路径
如果git clone到本地,文件默认在home/yourname/下(yourname是你的用户名);
否则先找到已经下载的rosdistro文件夹,如果已经找到文件夹,而不知道路径可以用以下命令查看,在该文件夹中打开终端并输入下列命令,即可得到路径信息
pwd
第二步,修改本地ROS文件路径
先执行
sudo rosdep init
然后打开文件
cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list
修改更新路径
#os-specific listings first
yaml file:///home/yourname/rosdistro/rosdep/osx-homebrew.yaml osx
#generic
yaml file:///home/yourname/rosdistro/rosdep/base.yaml
yaml file:///home/yourname/rosdistro/rosdep/python.yaml
yaml file:///home/yourname/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/yourname/rosdistro/releases/fuerte.yaml fuerte
#newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
修改后截图如下:
最后,修改Python中的路径
打开文件
cd /usr/lib/python2.7/dist-packages/rosdistro/
sudo gedit __init__.py
修改文件更新路径
DEFAULT_INDEX_URL = 'file:///home/yourname/rosdistro/index-v4.yaml'
修改后截图如下:
注:这里为Python2.7,Python3的话不一样,可参考文章[1]。
4、成功
执行
rosdep update
截图如下:
完美解决