ROS初始化rosdep问题的解决

系统:win10+VMware Workstation 15 Pro+ubuntu 16.04+ROS Kinetic/(ubuntu 18.04+ROS Melodic)
ROS详细安装方法可参考:
ubuntu16.04安装Ros(kinetic版本)
Ubuntu18.04下安装ROS

**问题描述:**我在ubuntu16.04和ubuntu18.04上安装ROS时都出现了初始化的问题。

1.问题一:在执行sudo rosdep init 时错误如下:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

针对这个问题,我在网上搜索解决方案时,找到的比较全的方法合集有如下两种:
sudo rosdep init ERROR: cannot download default sources list from:
ROS- 解决 rosdep update 出现的错误

方法是好方法,可是还是解决不了我的问题。经过一天的寻找,终于找到了一个适用我自身情况的解决办法,因为实在稀有,所以促成我写了这篇文章。

思路
既然说明连接不上,在自身网络连接通畅的情况下,应该是wall的问题,但我无法在ubuntu系统下翻过去,那么只能使用我们在用steam时出现-1XX时的同类方法:改hosts文件。具体操作如下:

#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133  raw.githubusercontent.com
#保持后退出再尝试

再重新尝试后会发现问题解决。

2.问题二描述:执行 rosdep update后错误如下:

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml
Add distro "groovy"
ERROR: error loading sources list:
    The read operation timed out

思路
如果用我前面给出的解决方法合集也无法解决time out问题的话可学习我的方法,参考Ubuntu16.04安装ROS Kinetic详细过程中评论回复的方法,先尝试看看小乌龟能否正常移动,能的话就放弃治疗吧,这不影响正常使用。

你可能感兴趣的:(ROS初始化rosdep问题的解决)