提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
在ROS中,执行rosdep update时可能遇到“read operation timed out”的错误,提示超时问题。这通常由网络连接不稳定、DNS解析失败或防火墙限制等原因引起。解决方法包括检查网络连接、更换DNS服务器、配置代理或使用VPN等。手动更新源列表也是一种应对方法。通过这些步骤,通常可以解决该问题,确保ROS的正常运行。
一、rosdep update 更新报错:read operation timed out
1. 问题描述
在安装ros时,使用rosdep update
指令进行更新时,出现报错:更新超时(read operation timed out
),具体的信息如下所示:
reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source
[https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml:
<urlopen error timed out (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: error loading sources list:(‘The read operation timed out’,)
报错的信息截图如下所示:
2. 原因分析
raw.githubusercontent.com
这个网站被墙,导致超时
3. 解决
(1) 科学上网,再次执行更新的指令
(2) 手动下载rosdep update所需的文件
将更新所需要的文件下载放在本地文件夹,并修改执行更新的路径。在本地完成更新。具体步骤如下:
1)本地下载更新所需要的文件
百度网盘的链接如下:
链接: https://pan.baidu.com/s/1_svhixikbatyeiIUrkC4Xw
提取码: r6tb
2)将提取出的文件夹移动到/etc/ros文件夹下
3) 修改更新文件路径
① 修改index-v4.yaml
路径:
终端输入:
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
将该文件中第68行代码注释并添加
file:///etc/ros/ros_github/index-v4.yaml
添加位置如下图所示:
② 修改/etc/ros/rosdep/sources.list.d/20-default.list
文件
终端输入:
sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list
再将原有内容全部注释 。最后添加以下内容在文档中:
(3) 再次执行rosdep update
若显示如下信息,则表示rosdep update
成功:
成功的提示信息:
reading in sources list data from /etc/ros/rosdep/sources.list.d Hit
file:///etc/ros/ros github/osx-homebrew.yaml Hit file:///etc/ros/ros
github/base.yaml Hit file:///etc/ros/ros github/python.yaml Hit
file:///etc/ros/ros github/ruby.yaml Hit file:///etc/ros/ros
github/fuerte.yaml Query rosdistro index file:///etc/ros/ros
github/index-v4.yaml Skip end-of-life distro “ardent” Skip end-of-life
distro"bouncy" Skip end of-life distro “crystal” Add distro “dashing”
Add distro “eloquent” Add distro “foxy” Skip end-of-life distro
“groovy“ Skip end-of-life distro"hydro” Skip end-of-life distro
“indigo” Skip end-of-life distro “jade” Add distro “kinetic” Skip
end-of-life distro "lunar” Add distro “melodic” Add distro “noetic”
Add distro “rolling” updated cache in
/home/chen/.ros/rosdep/sources.cache
页面如下:
以上就是在ubunut18.04安装ROS时更新报错:The read operation timed out的问题的全部解决过程,有什么问题。可以评论区留言讨论交流!