rosdep init和rosdep 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被墙,程序无法下载相应的文件导致的。解决方法就是使得raw.githubusercontent.com能够被正常访问。这个网站被墙的方式是dns污染,所以我们只要能够找到这个网站的正确ip就可以了。

199.232.28.133 raw.githubusercontent.com

添加到自己电脑的hosts文件里面,文件路径为/etc/hosts

此时再次执行 rosdep init

 

如果执行rosdep update出现问题

先是更改 /usr/lib/python2.7/dist-packages/rosdep2/下的三个文件sources_list.pygbpdistro_support.pyrep3.py
中的DOWNLOAD_TIMEOUT = 15.0值,改大一点就可以了。改到大概60.0,但还是不行。于是索性直接写了个一直重复运行rosdep update命令的bash脚本:

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

运行一晚上就成了

 

你可能感兴趣的:(rosdep init和rosdep update出现问题解决)