【ROS1::melodic】虚拟机下melodic安装教程2/2

  • Post author:
  • Post category:其他





重要!重要!重要!





解决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环境搭建完成。



版权声明:本文为spaceshield原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。