此问题的解决也适用ros1
1、初始化
$ sudo rosdep init
2、下载rosdistro到本地
$ git clone https://github.com/ros/rosdistro.git
3、修改以下文件,将其url指向本地
(1)文件1:20-default.list
地址路径:/etc/ros/rosdep/sources.list.d/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
修改后:
# os-specific listings first
yaml file:///home/hqauto/workspace/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/hqauto/workspace/rosdistro/rosdep/base.yaml
yaml file:///home/hqauto/workspace/rosdistro/rosdep/python.yaml
yaml file:///home/hqauto/workspace/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/hqauto/workspace/rosdistro/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
(2)文件2:/usr/lib/python2.7/dist-packages/rosdep2/main.py
地址路径:/usr/lib/python3/dist-packages/rosdep2/main.py
这里没有,不用修改。
(3)文件3:/usr/lib/python2.7/dist-packages/rosdep2/rep3.py
地址路径:/usr/lib/python3/dist-packages/rosdep2/rep3.py
原来内容:
REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'dd
修改后:
REP3_TARGETS_URL = 'file:///home/hqauto/workspace/rosdistro/releases/targets.yaml'
(4)文件4:/usr/lib/python2.7/dist-packages/rosdistro/__init__.py
地址路径:/usr/lib/python3/dist-packages/rosdistro/__init__.py
原来内容:
DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
修改后:
DEFAULT_INDEX_URL = 'file:///home/hqauto/workspace/rosdistro/index-v4.yaml'