1.教程
https://www.linuxidc.com/Linux/2019-03/157199.htm
2.密钥错误,则:这个可以用
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
3.
sudo rosdep init
此时,却遇到了一个问题
ERROR: cannot download default sources list from: https://raw.github.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down.
解法1:该问题可能是The Great Wall的原因,反正在开启VPN之后此问题得到了解决,有时通过手机热点也能成功,可能是网络问题。
解法2:修改/ros/rosdep/source.list.d/20-default.list文件(githubusercontent全改为github)(这种方法还没试過)
解法3:在/etc目录下新建/ros/rosdep/sources.list.d/20-default.list 写入以下代码:
# os-specific listings first yaml https://raw.githubusercontent.com/ros/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
注:这里虽然手动新建了20-default.list,但执行sudo rosdep init依然会出现之前的错误,这里我们无视,继续执行下一步。会在下一步出现问题:
4. rosdep update 出现以下问题:
reading in sources list data from /etc/ros/rosdep/sources.list.d ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]: Failed to download target platform data for gbpdistro: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml ERROR: error loading sources list: <urlopen error <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>
解决:
在/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py中顶部直接插入两行代码取消SSL验证
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
再次rosdep update 成功升级,至此终于完成rosdep初始化,问题解决,大功告成。
转自
https://zhuanlan.zhihu.com/p/77483614
感谢大神。另外,最好把自己的安装环境作成系统盘,避免一次又一次的配置环境。祝好!!!