sudo rosdep init时出现错误: ERROR: cannot download default sources list from

1、问题
按照官网一步一步来看似很顺利,但当走到最后一步时:

$ sudo rosdep init
$ rosdep update

在进行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.

小作很苦恼,但将连接复制到浏览器里时却发现浏览器也打不开该网页,说明是由于网站为国外网站所导致的。
在网上搜到对我自己最有效的解决办法现记录如下:
在通过某种手段打开上述连接后发现为一个文件,但是下载不到,那么就通过本地创建的方法建立。
(1)在本地创建目录/etc/ros/rosdep/sources.list.d,并进入

/etc/ros/rosdep/sources.list.d
$ cd /etc/ros/rosdep/sources.list.d

(2)自己创建一个20-default.list,并进行编辑

sudo gedit 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

并将其中所有的raw.githubusercontent.com改为raw.github.com,则得到最终的20-default.list,如下:

# os-specific listings first
yaml https://raw.github.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://raw.github.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.github.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

(3)在终端直接运行

rosdep update

得到以下信息便成功!

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.github.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.github.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.github.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.github.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.github.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/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/userName/.ros/rosdep/sources.cache

该方法就是将网页中的文件人为放置到本地位置!!代替sudo rosdep init.

你可能感兴趣的:(ros,笔记,自动驾驶)