重要!重要!重要!

解决melodic过程中遇到的问题。

执行命令:

rosdep update

出现错误如下:(注意:命令中不需要sudo )

 意思就是网速太慢了,下载不了20-default.list这个文件。

自己在路径下(/etc/ros/rosdep/sources.list.d)创建这个文件。 

mkdir -r /etc/ros/rosdep/sources.list.d

 可以复制添加文件内容

# os-specific listings first
# yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:/etc/ros/rosdep/sources.list.d/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

 在/etc/resolv.conf将原先的nameserver屏蔽,添加两个nameserver

打开etc/hosts文件添加

 还有的教程是修改时间值,我改了没有用

 

解决掉20-default.list这个文件。

执行rosdep update更新不成功的问题。

太多方法都没解决。

 解决方法:

1、下载rosdistro-master.zip

链接:https://pan.baidu.com/s/1WSZRVfL0cld0WIzhrYKkBw 
提取码:zxcv

2、修改20-default.list文件内容如下

# os-specific listings first
# yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:/etc/ros/rosdep/sources.list.d/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

yaml file:/etc/ros/rosdep/sources.list.d/rosdistro-master/rosdep/base.yaml
yaml file:/etc/ros/rosdep/sources.list.d/rosdistro-master/rosdep/python.yaml
yaml file:/etc/ros/rosdep/sources.list.d/rosdistro-master/rosdep/ruby.yaml
gbpdistro file:/etc/ros/rosdep/sources.list.d/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

3、将下载好的rosdistro-master.zip解压后复制到路径(/etc/ros/rosdep/sources.list.d)下,

执行命令:

 该路径中文件情况

 【关键步骤】下面执行3个命令修改其中的网址信息

 DEFAULT_SOURCES_LIST_URL行的信息

 执行命令,

 REP3_TARGETS_URL行

 执行命令,

 DEFAULT_INDEX_URL行

 3条命令修改完成后,执行 

rosdep update

 出现下述界面说明安装成功。

接下来测试安装环境:

 我擦,这么情况,继续解决

继续执行命令:

sudo apt-get install ros-melodic-desktop

 待安装完成后

再行执行roscore

 打开3个终端,测试小乌龟

 ROS环境搭建完成。

 

Logo

华为AI开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐