sudo rosdep init update 出错的最新解决方案

2024-03-19 06:38

本文主要是介绍sudo rosdep init update 出错的最新解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题分析

安装ros 执行sudo rosdep init 或者rosdep update出错的主要原因:https://raw.githubusercontent.com网站国内访问受限

最新解决方案

原理

既然网站服务器访问受限,不如把服务器中的文件拷贝下来,在本地进行 init和update.

第一步 下载服务器中的文件

打开终端,输入下面指令:

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

最终会得到所用的文件,文件路径为(注意user替换为自己的用户名):

/home/user/rosdistro

第二步 修改文件

  1. 20-default.list文件,将服务器地址更换为本地。
sudo gedit /home/user/rosdistro/rosdep/sources.list.d/20-default.list 
# os-specific listings first
yaml file:///home/yourname/rosdistro/rosdep/osx-homebrew.yaml osx# generic
yaml file:///home/user/rosdistro/rosdep/base.yaml
yaml file:///home/user/rosdistro/rosdep/python.yaml
yaml file:///home/user/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/user/rosdistro/releases/fuerte.yaml fuerte# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
  1. gbpdistro_support.py 文件,同理。
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
FUERTE_GBPDISTRO_URL = 'file:///home/user/rosdistro/releases/fuerte.yaml'
  1. rep3.py文件
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
REP3_TARGETS_URL = 'file:///home/user/rosdistro/releases/targets.yaml'
  1. _init_.py文件
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
DEFAULT_INDEX_URL = 'file:///home/user/rosdistro/index-v4.yaml'

第三步 创建20-default.list文件,模拟 执行rosdep init的过程

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

复制以下内容,保存退出。

#os-specific listings first
yaml file:///home/user/rosdistro/rosdep/osx-homebrew.yaml osx
#generic
yaml file:///home/user/rosdistro/rosdep/base.yaml
yaml file:///home/user/rosdistro/rosdep/python.yaml
yaml file:///home/user/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/user/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命令

rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/user/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/user/rosdistro/rosdep/base.yaml
Hit file:///home/user/rosdistro/rosdep/python.yaml
Hit file:///home/user/rosdistro/rosdep/ruby.yaml
Hit file:///home/user/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/user/rosdistro/index-v4.yaml
Skip end-of-life distro "ardent"
Add distro "bouncy"
Add distro "crystal"
Add distro "dashing"
Add distro "eloquent"
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"
updated cache in /home/user/.ros/rosdep/sources.cache

至此问题解决。

这篇关于sudo rosdep init update 出错的最新解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/825109

相关文章

MySQL主从同步延迟问题的全面解决方案

《MySQL主从同步延迟问题的全面解决方案》MySQL主从同步延迟是分布式数据库系统中的常见问题,会导致从库读取到过期数据,影响业务一致性,下面我将深入分析延迟原因并提供多层次的解决方案,需要的朋友可... 目录一、同步延迟原因深度分析1.1 主从复制原理回顾1.2 延迟产生的关键环节二、实时监控与诊断方案

Maven中引入 springboot 相关依赖的方式(最新推荐)

《Maven中引入springboot相关依赖的方式(最新推荐)》:本文主要介绍Maven中引入springboot相关依赖的方式(最新推荐),本文给大家介绍的非常详细,对大家的学习或工作具有... 目录Maven中引入 springboot 相关依赖的方式1. 不使用版本管理(不推荐)2、使用版本管理(推

usb接口驱动异常问题常用解决方案

《usb接口驱动异常问题常用解决方案》当遇到USB接口驱动异常时,可以通过多种方法来解决,其中主要就包括重装USB控制器、禁用USB选择性暂停设置、更新或安装新的主板驱动等... usb接口驱动异常怎么办,USB接口驱动异常是常见问题,通常由驱动损坏、系统更新冲突、硬件故障或电源管理设置导致。以下是常用解决

一文带你搞懂Python中__init__.py到底是什么

《一文带你搞懂Python中__init__.py到底是什么》朋友们,今天我们来聊聊Python里一个低调却至关重要的文件——__init__.py,有些人可能听说过它是“包的标志”,也有人觉得它“没... 目录先搞懂 python 模块(module)Python 包(package)是啥?那么 __in

Python中__init__方法使用的深度解析

《Python中__init__方法使用的深度解析》在Python的面向对象编程(OOP)体系中,__init__方法如同建造房屋时的奠基仪式——它定义了对象诞生时的初始状态,下面我们就来深入了解下_... 目录一、__init__的基因图谱二、初始化过程的魔法时刻继承链中的初始化顺序self参数的奥秘默认

Windows Docker端口占用错误及解决方案总结

《WindowsDocker端口占用错误及解决方案总结》在Windows环境下使用Docker容器时,端口占用错误是开发和运维中常见且棘手的问题,本文将深入剖析该问题的成因,介绍如何通过查看端口分配... 目录引言Windows docker 端口占用错误及解决方案汇总端口冲突形成原因解析诊断当前端口情况解

Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案

《Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案》:本文主要介绍Vue3组件中getCurrentInstance()获取App实例,但是返回nu... 目录vue3组件中getCurrentInstajavascriptnce()获取App实例,但是返回n

Spring Boot循环依赖原理、解决方案与最佳实践(全解析)

《SpringBoot循环依赖原理、解决方案与最佳实践(全解析)》循环依赖指两个或多个Bean相互直接或间接引用,形成闭环依赖关系,:本文主要介绍SpringBoot循环依赖原理、解决方案与最... 目录一、循环依赖的本质与危害1.1 什么是循环依赖?1.2 核心危害二、Spring的三级缓存机制2.1 三

Node.js 数据库 CRUD 项目示例详解(完美解决方案)

《Node.js数据库CRUD项目示例详解(完美解决方案)》:本文主要介绍Node.js数据库CRUD项目示例详解(完美解决方案),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考... 目录项目结构1. 初始化项目2. 配置数据库连接 (config/db.js)3. 创建模型 (models/

Vuex Actions多参数传递的解决方案

《VuexActions多参数传递的解决方案》在Vuex中,actions的设计默认只支持单个参数传递,这有时会限制我们的使用场景,下面我将详细介绍几种处理多参数传递的解决方案,从基础到高级,... 目录一、对象封装法(推荐)二、参数解构法三、柯里化函数法四、Payload 工厂函数五、TypeScript