博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ROS初始化时候sudo rosdep init rosdep update出现的各种问题亲测成功的解决办法(2020.12.29已解决!)
阅读量:4167 次
发布时间:2019-05-26

本文共 2236 字,大约阅读时间需要 7 分钟。

在安装ROS 时候教程需要初始化,执行sudo rosdep init rosdep update,但是不初始化也不会有什么问题(至少我自己用了很久是这样)。

最近想安装cartographyer构建栅格地图,必须执行sudo rosdep init rosdep update,才反复实验,但是一直有问题,试验了很久很久,直到今天早上全部解决了!!!三个感叹号表达一下我的喜悦。
正篇开始:
记录:
初始化:

一、sudo rosdep init

sudo rosdep init

初始化错误:sudo: rosdep:找不到命令

解决办法:安装python-rosdep

sudo apt-get install python-rosdep

在终端重来:

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、打开terminal控制台,输入:

sudo gedit /etc/hosts

这个命令中的gedit是文本编辑器;

2、在打开的文件末尾一行添加:

151.101.76.133 raw.githubusercontent.com

PS:很多人让改为151.101.84.133 raw.githubusercontent.com,但是亲测76比84好使用)

3、保存退出,在terminal中输入: sudo rosdep init

成功!终端建议rosdep update,也就是最后一行出现rosdep update

在这里插入图片描述

二、rosdep update:

运行

rosdep update

出现问题: unable to process source 这里很多教程说是什么源被污染,我的实际情况 如下:

在这里插入图片描述

试了很多后最后成功的解决办法:

打开网址:

https://site.ip138.com

输入:

raw.githubusercontent.com

在这里插入图片描述

在里面挑一个(不行就换下一个,还不行就都加上)IP(有美国,日本,中国香港等等),和raw.githubusercontent.com组成,并且把这一句加入到/etc/hosts里的最后,然后格式要和上面一致(IP+raw.githubusercontent.com,例如:151.101.76.133 raw.githubusercontent.com)。

/etc/hosts使用如下命令打开:

sudo gedit /etc/hosts

我是加入0.0.0.0 http://raw.githubusercontent.com 后成功的。。

最后设置完就是这样子了:

在这里插入图片描述
直接将图片中的文本放在这里,你也可以直接复制下面的 IP+raw.githubusercontent.com拿去试试,好用的话点赞收藏一下:

127.0.0.1	localhost127.0.1.1	tianchengyaun# The following lines are desirable for IPv6 capable hosts::1     ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters151.101.88.133 raw.githubusercontent.com151.101.228.133 raw.githubusercontent.com151.101.76.133 raw.githubusercontent.com223.100.167.69 raw.githubusercontent.com192.168.1.108   raw.githubusercontent.com199.232.28.133 raw.githubusercontent.com151.101.84.133 raw.githubusercontent.com199.232.28.133 http://raw.githubusercontent.com151.101.108.133 http://raw.githubusercontent.com151.101.0.133 http://raw.githubusercontent.com0.0.0.0http://raw.githubusercontent.com

保存,关闭推出host。

回到终端:

rosdep update

完美:

在这里插入图片描述
在这里插入图片描述最后的rosdep update可能很慢,耐心等下。如果还是不行就在添加IP进去,再试,我按照这办法多次成功。

很多同学遇到了timeout 的问题,我没有遇到过这种,一直都是ERROR: unable to process source+·[网址],遇到timeout可以试试手机热点和更换源的办法.更换源也就是一命令行的事情。

最后,遇到ERROR不要放弃,肯定能够成功的,愿世界没有ERROR,没有Bug!

转载地址:http://jjexi.baihongyu.com/

你可能感兴趣的文章
java接口中方法的默认访问修饰符为public
查看>>
java多线程之并发synchronized
查看>>
java多线程之并发Lock
查看>>
微信公众平台基础配置
查看>>
jpa 和 hibernate 的联系
查看>>
SpringBoot之@SpringBootApplication注解
查看>>
ajax 传JSON 写法
查看>>
SpringBoot之web发展史
查看>>
SpringBoot之开发web页面
查看>>
SpringBoot之快速部署
查看>>
springBoot之jar包在后台(运行:编写start、stop脚本)
查看>>
redis学习
查看>>
SpringBoot之application.properties文件能配置的属性
查看>>
javaWeb监听器、过滤器、拦截器
查看>>
RESTFUL风格的接口
查看>>
后台参数验证配置
查看>>
SpringBoot之外置Tomcat配置
查看>>
java 删除 list 中的元素
查看>>
idea启动优化
查看>>
java发展史
查看>>