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.

修改hosts

sudo vim /etc/hosts

在最后一样加入

151.101.84.133 raw.githubusercontent.com
# 这个ip 可能不行,可以去https://www.ipaddress.com/输入raw.githubusercontent.com查找新的ip

rosdep update

  • 下载rosdistro
git clone https://github.com/ros/rosdistro.git
  • 下载后放到这个目录
/home/<username>/rosdistro
#  <username>就是你的用户名字
eg:
/home/yunhgu/rosdistro
  • 修改/usr/lib/python2.7/dist-packages/rosdep2/rep3.py文件
cd /usr/lib/python2.7/dist-packages/rosdep2
sudo vim rep3.py
将REP3_TARGETS_URL = ‘https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml’ 
替换成 REP3_TARGETS_URL = 'file:///home/yunhgu/rosdistro/releases/targets.yaml'
替换后的/home/yunhgu 即为第一步clone内容的存放地址 
  • 修改/usr/lib/python2.7/dist-packages/rosdistro/init.py文件
将原来文件中的 DEFAULT_INDEX_URL = ‘https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml’
替换成 DEFAULT_INDEX_URL = 'file:///home/yunhgu/rosdistro/index-v4.yaml'
替换后的/home/yunhgu 即为第一步clone内容的存放地址
  • 修改/etc/ros/rosdep/sources.list.d/20-default.list
    内容如下
# os-specific listings first
yaml file:///home/yunhgu/rosdistro/rosdep/osx-homebrew.yaml osx

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

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
  • 运行
rosdep update

方案二

https://www.guyuehome.com/35408

posted @   不能说的秘密  阅读(119)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示