栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

rosdep update出错(安装ROS过程中的rosdep init 和 rosdep update 命令执行不成功的解决办法)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

rosdep update出错(安装ROS过程中的rosdep init 和 rosdep update 命令执行不成功的解决办法)

一 .解决 rosdep init 命令执行不成功 :

不成功信息:

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

解决方法:

第一步:登陆 IPAddress.com 首页并输入 raw.githubusercontent.com 查询最新网址,一般选择第一个网址就可以,再与 raw.githubusercontent.com 以如下格式输入到/etc/hosts 文件的最后一行.

185.199.108.133 raw.githubusercontent.com

第二步:执行 sudo rosdep init 即可成功.

二 . 解决rosdep update 命令不成功:

不成功信息大体如下:

eading 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]:
     (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
     (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: error loading sources list:
    The read operation timed out

解决方法:

第一步: 克隆 rosdistro 文件版本地, 执行:

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

保存到一个明确的位置.

第二步: 将URL路径改为本地 rosdistro 文件路径

1.

cd /文件路径/rosdistro/rosdep/sources.list.d/  
sudo vim 20-default.list

修改后:

# os-specific listings first
yaml file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml osx

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

2.  需注意: melodic 版本及以前版本在 python2.7 路径下修改, Noetic 在 python3 路径下修改

cd /usr/lib/python3/dist-packages/rosdep2/
sudo vim gbpdistro_support.py

修改后:

FUERTE_GBPDISTRO_URL = 'file:///home/rosSoftware/rosdistro/'
    'releases/fuerte.yaml'

 3.

cd /usr/lib/python3/dist-packages/rosdep2/
sudo gedit rep3.py

修改后:

REP3_TARGETS_URL = 'file:///home/rosSoftware/rosdistro/releases/targets.yaml'

 4.

cd /usr/lib/python3/dist-packages/rosdistro/
sudo gedit __init__.py

修改后:

DEFAULT_INDEX_URL = 'file:///home/rosSoftware/rosdistro/index-v4.yaml'

5. 

cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

修改后:

yaml file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml osx

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

第三步: 执行 sudo rosdep update

执行结果若如下则成功:

eading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/base.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/python.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/ruby.yaml
Hit file:///home/rosSoftware/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/rosSoftware/rosdistro/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/.ros/rosdep/sources.cache

*rosdistro本地路径及内部文件路径一定要正确*

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/772722.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号