ROS 的时候遇到Website may be down

安装 ROS 的时候遇到Website may be down情况.

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.

Website down的原因

可以看到raw.githubusercontent.com这个网站的原因,因为是国外的网站,由于防火墙的原因,会出现一些问题。
我们直接打开rosdep的地址:
github.com/ros/rosdistro

解决方法

首先到如下网站所需包下载:
https://github.com/ros/rosdistro

也可以打开终端输入以下指令:

git clone https://github.com/ros/rosdistro.git

具体步骤

修改下载下来的包中rosdep/source.list.d下的文件20-default.list
将其中为raw.githubusercontent.com的url地址全部修改为本地文件的地址。

# os-specific listings first
yaml file:///home/xxx/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/xxx/rosdistro/rosdep/base.yaml
yaml file:///home/xxx/rosdistro/rosdep/python.yaml
yaml file:///home/xxx/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/xxx/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中URL地址

cd /usr/lib/python2.7/dist-packages/rosdep2

/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py

# default file to download with 'init' command in order to bootstrap
# rosdep
DEFAULT_SOURCES_LIST_URL = 'file:///home/xxx/rosdistro/rosdep/sources.list.d/20-default.list'

# seconds to wait before aborting download of rosdep data

/usr/lib/python2.7/dist-packages/rosdep2/rep3.py

# location of targets file for processing gbpdistro files
REP3_TARGETS_URL = 'file:///home/xxx/rosdistro/releases/targets.yaml'

# seconds to wait before aborting download of gbpdistro data

/usr/lib/python2.7/dist-packages/rosdistro/init.py

# index information

DEFAULT_INDEX_URL = 'file:///home/xxx/rosdistro/index-v4.yaml'
sudo rosdep init
rosdep update

解决问题!