目录
一般的安装步骤按照官方的文档来,主要遇到的问题就是在rosdep update的unable to process source xxxxxx,以及rosdep init
1.rosdep update 超时
每次都timed out
网上很多方法:更换热点,延长DOWNLOAD_TIMEOUT、 githubusercontent改成github、添加DNS、以及其他科学的方法也试过了。
看一下它的链接,看到有些博客提到将default中的githubusercontent改成github,那就直接按照链接去github上找,就能发现下载总是失败的这几个yaml文件。
只有几百kb,可以直接下载下来,放到/etc/ros/目录下
然后将default中的链接换成本地路径 /etc/ros/xx/xxx
写法可参考:安装ROS, 初始化时rosdep update出错解决办法_super_sean的博客-优快云博客_rosdep update出错
以base.yaml为例
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
改成
yaml file:///etc/ros/rosdistro-master/rosdep/base.yaml
注意fuerte.yaml和前面的不一样,是在releases目录下的。
2.rosdep init 失败
解决方案1:
sudo rosdep init最终的结果就是在/etc/ros/rosdep/sources.list.d/目录下生成了20-default.list这个文件,所以可以自己手动创建目录和文件,全部创建完后去执行rosdep update
1.打开报错中提到的链接,复制内容。如果链接打不开也可以直接复制下面的
2.手动创建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
解决方案2:
查询域名raw.githubusercontent.com的ip
之后执行
gedit /etc/hosts
在末尾添加
#查询到的ip raw.githubusercontent.com
#例如
xxx:xxx:xxx:xxx raw.githubusercontent.com
save之后执行sudo rosdep init
这个还是看网络,有时候能成功
3.roscore not found
roscore
Command 'roscore' not found, but can be installed with:
sudo apt install python-roslaunch
Ubuntu18直接照着下面的来