按照ROS官网教程在虚拟机中的Ubuntu18中安装ROS,到初始化rosdep步骤时出现问题,按照网上编辑hosts文件添加IP地址或者手动创建/etc/ros/rosdep/sources.list.d/20-default.list等方法都可以解决以下命令的报错问题:
$ sudo rosdep init
但是没有找到能解决rosdep update报错问题的方法。
随后参照https://www.cnblogs.com/stpaul/articles/14805360.html中的添加代理的方法:
“……报错信息中得知,该函数名为download_rosdep_data,位于/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py。我们修改这一函数,添加:url="https://ghproxy.com/"+url
应用ghproxy的代理服务……”
但是仍然报错,受其启发,修改了20-default.list文件,在每个url前面加上代理“https://ghproxy.com/”
# os-specific listings first
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/ro