ROS安装过程中执行命令rosdep update失败问题

我使用的环境是Ubuntu16.04 + Kinetic。

按照官方的教程,执行到

rosdep update

这个命令时提示:

<urlopen error <urlopen error ('_ssl.c:574: The handshake operation timed out',)> 

解决方法:

1. 将需要使用的包直接下载下来

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

连接github可能需要修改hosts文件

52.74.223.119   github.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
185.199.112.133 raw.githubusercontent.com

ip地址是动态的,使用IPAddress查询。

2. 修改rosdep需要执行的python文件,将其中的URL后的地址设置成这个安装包的安装位置

cd /usr/lib/python2.7/dist-packages
sudo gedit rosdep2/rep3.py
sudo gedit rosdistro/__init__.py
sudo gedit rosdep2/sources_list.py

修改rep3.py文件为REP3_TARGETS_URL = 'file:///home/chenpeng/rosdistro/releases/targets.yaml' 

修改__init__.py文件为DEFAULT_INDEX_URL = 'file:///home/chenpeng/rosdistro/index-v4.yaml'

修改rosdep2/sources_list.py文件为DEFAULT_SOURCES_LIST_URL = 'file:///home/chenpeng/rosdistro/rosdep/sources.list.d/20-default.list'

3. 修改文件/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
yaml file:///home/chenpeng/rosdistro/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
yaml file:///home/chenpeng/rosdistro/rosdep/base.yaml
yaml file:///home/chenpeng/rosdistro/rosdep/python.yaml
yaml file:///home/chenpeng/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/chenpeng/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/rosdistro/__init__.py

# index information
 
#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/master/index-v4.yaml'

之后就执行成功了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值