方法一:
一、 解决rosdep_init问题
正常执行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.
解决方案:
此解决方案的原理是基于手动完成sudo rosdep init的步骤,然后再通过rosdep update完成整个方案的实施。
步骤一:首先打开一个终端
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
步骤三:执行以下指令
rosdep update(一般会失败,请继续看下文)
参考资料:https://www.guyuehome.com/12640
二、 解决rosdep_update问题
由于近期国内Github Raw的可用IP越来越少,通过修改hosts文件解决rosdep update超时问题的方法已经不太好用,本文通过修改rosdep源码中下载资源的函数来解决这一问题。
网站https://ghproxy.com/支持github的资源代理,非常好用,我们将用此代理加速rosdep对Github Raw的访问,进而