一、原因
因为最近github网站不太好进,导致rosdep update很容易出错,所以选择下载rosdistro到本地。
二、下载
链接:https://pan.baidu.com/s/1hEwepV_1rPjDMFvxFUcVpQ
提取码:edpk
三、配置
将rosdistro.zip压缩包解压到home下,并且文件夹名字改为rosdistro
1.修改 20-default.list
sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list
改为以下:
# os-specific listings first
yaml file:///home/xx/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/xx/rosdistro/rosdep/base.yaml
yaml file:///home/xx/rosdistro/rosdep/python.yaml
yaml file:///home/xx/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/xx/rosdistro/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
上面的xx为自己电脑的名字,注意检查路径是否正确
2.修改 sourceslist.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
注释掉DEFAULT_SOURCES_LIST_URL一行(前面加#)添加以下:
DEFAULT_SOURCES_LIST_URL = 'file:///home/xx/rosdistro/rosdep/sources.list.d/20-default.list'
2.修改 rep3.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
注释REP3_TARGETS_URL 一行,添加以下:
REP3_TARGETS_URL = 'file:///home/xx/rosdistro/releases/targets.yaml'
3.修改 __init.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
注释 DEFAULT_INDEX_URL 一行,添加以下:
DEFAULT_INDEX_URL = 'file:///home/xx/rosdistro/index-v4.yaml'
四、测试
rosdep update
出现以下:
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/xx/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/xx/rosdistro/rosdep/base.yaml
Hit file:///home/xx/rosdistro/rosdep/python.yaml
Hit file:///home/xx/rosdistro/rosdep/ruby.yaml
Hit file:///home/xx/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/xx/rosdistro/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/xx/.ros/rosdep/sources.cache
成功