文章目录
在安装ros过程中,rosdep update几乎每次遇到报错:
ERROR: error loading sources list: (‘The read operation timed out’,)
报错如下图所示:
解决方法:
1.手动下载rosdep包
git clone https://gitee.com/francois_WAN/rosdistro.git
2.进入目录/etc/ros/rosdep/sources.list.d下
cd /etc/ros/rosdep/sources.list.d
赋予编辑权限:
sudo chmod 777 * -R
将下载的rosdistro文件移动到ros文件夹下:
3.对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:///etc/ros/rosdistro/rosdep/osx-homebrew.yaml osx
#generic
yaml file:///etc/ros/rosdistro/rosdep/base.yaml
yaml file:///etc/ros/rosdistro/rosdep/python.yaml
yaml file:///etc/ros/rosdistro/rosdep/ruby.yaml
gbpdistro file:///etc/ros/rosdistro/releases/fuerte.yaml fuerte
#newer distributions (Groovy, Hydro, …) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
4.进入到 /usr/lib/python2.7/dist-packages/rosdep2/文件夹下
cd /usr/lib/python2.7/dist-packages/rosdep2/
- 对文件gbpdistro_support.py进行修改:
sudo gedit gbpdistro_support.py
#location of an example gbpdistro file for reference and testing
FUERTE_GBPDISTRO_URL = ‘file:///etc/ros/rosdistro/releases/fuerte.yaml’
- 对同一文件夹下的 rep3.py文件进行修改:
sudo gedit rep3.py
#location of targets file for processing gbpdistro files
REP3_TARGETS_URL = ‘file:///etc/ros/rosdistro/releases/targets.yaml’
- 对 /usr/lib/python2.7/dist-packages/rosdistro/文件夹下的 gedit __init__.py文件进行修改:
cd /usr/lib/python2.7/dist-packages/rosdistro/
sudo gedit __init__.py
#index information
DEFAULT_INDEX_URL = ‘file:///etc/ros/rosdistro/index-v4.yaml’
5.再次执行 rosdep update:
6.运行成功!
其他问题可参考:
https://blog.csdn.net/learning_man/article/details/119766435