2021-06-21

Ubuntut16.04安装ROS-kinetic时运行sudo rosdep init报错,“https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down”

Ubuntut16.04安装ROS-kinetic时出现如下问题解决方案,本文参考了网上的一些链接,但大多不够详细,本文将详细的列出解决该问题的每一步包括截图解释:
根据网友常说的在安装ROS-kinetic时运行sudo rosdep init指令时会报如下错误,

https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down
解决方法
1.先进入github.com/ros/rosdistro,把这个包下载下来,下载包是一个名为rosdistro-master的压缩包,将解压后的该文件放到/home/miao/下(注:miao是我的计算机名,所以该位置需换成你的计算机名),我顺便将该文件重新命名了为rosdistro
2021-06-21
2.
进入解压的包,修改这个包中rosdep/source.list.d/下的文件20-default.list,将这个文件中指向raw.githubusercontent.com的url地址全部修改为指向本地文件(第一步解压后的包)的地址,也就是该下载好的包的地址,具体修改如下:
修改前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

修改后20-default.list的文件
#os-specific listings first
yaml file:///home/miao/rosdistro/rosdep/osx-homebrew.yaml osx

#generic
yaml file:///home/miao/rosdistro/rosdep/base.yaml
yaml file:///home/miao/rosdistro/rosdep/python.yaml
yaml file:///home/miao/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/miao/rosdistro/releases/fuerte.yaml fuerte

#newer distributions (Groovy, Hydro, …) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
其中/home/miao/是第一步解压后的文件所在地址(若不知道此处路径,可以将rosdistro文件夹选中拖到一个终端里面,此时终端会显示该文件的所在的路径)
3.修改/usr/lib/python2.7/dist-packages/rosdep2下的sources_list.py文件里面的代码:
注意该文件直接双击打开是修改不了的,要通过权限才能修改,需要在/usr/lib/python2.7/dist-packages/rosdep2文件夹下打开一个终端,如下图
2021-06-21
在该终端下输入sudo gedit sources_list.py即可打开该文件,打开后进行如下修改修改:
修改前
#default file to download with ‘init’ command in order to bootstrap
#rosdep
DEFAULT_SOURCES_LIST_URL = ‘file:///home/miao//rosdistro/rosdep/sources.list.d/20-default.list’
#seconds to wait before aborting download of rosdep data
DOWNLOAD_TIMEOUT = 15.0

修改后

#default file to download with ‘init’ command in order to bootstrap
#rosdep
DEFAULT_SOURCES_LIST_URL = ‘file:///home/miao//rosdistro/rosdep/sources.list.d/20-default.list’
#seconds to wait before aborting download of rosdep data
DOWNLOAD_TIMEOUT = 15.0

4.修改以下两个文件里面的代码(文件的打开方式与步骤2提到的方式一样,这里就不在赘述了)
/usr/lib/python2.7/dist-packages/rosdep2/rep3.py
/usr/lib/python2.7/dist-packages/rosdistro/init.py
具体操作如下
将/usr/lib/python2.7/dist-packages/rosdep2/rep3.py文件修改成
#location of targets file for processing gbpdistro files
REP3_TARGETS_URL = ‘file:///home/miao/rosdistro/releases/targets.yaml’
#seconds to wait before aborting download of gbpdistro data

将/usr/lib/python2.7/dist-packages/rosdistro/init.py的文件修改成
#index information
DEFAULT_INDEX_URL = ‘file:///home/miao/rosdistro/index-v4.yaml’
def get_index_url():

5.执行完以上步骤后再执行 sudo rosdep init,显示如下图片表示sudo rosdep init执行成功
2021-06-21

参考链接:https://zhuanlan.zhihu.com/p/107218921
https://blog.csdn.net/nanianwochengshui/article/details/105702188

上一篇:计算机图形学入门(十一)-几何(网格处理)


下一篇:人类高质量 Java 学习路线【一条龙版】