Cartographer官方安装流程遇到的坑

现在Cartographer官方安装流程比较简单,本人也是参考官方的流程进行安装

https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html#building-installation 

坑1:

在执行下列命令时出现了如下的问题

wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall

方法a: 这个命令主要是将cartographer_ros.rosinstall下载下来并放到carto_ws/src目录下,由于某些原因,国内可能无法访问,所以最好的办法就是自己创建一个.roinstall文件啦,参考下面的内容

命令:gedit src/.rosinstall, gedit src/cartographter_ros/cartographter_ros.rosinstall
填入下面的内容:
- git: {local-name: cartographer, uri: 'https://github.com/googlecartographer/cartographer.git', version: '1.0.0'}
- git: {local-name: cartographer_ros, uri: 'https://github.com/googlecartographer/cartographer_ros.git', version: '1.0.0'}
- git: {local-name: ceres-solver, uri: 'https://ceres-solver.googlesource.com/ceres-solver.git', version: '1.13.0'}

方法b: 将

输入网址:ipaddress 查询 raw.githubusercontent.com 的IP地址,并修改hosts文件

Cartographer官方安装流程遇到的坑_第1张图片

sudo gedit /etc/hosts
添加下面的内容

199.232.68.133  raw.githubusercontent.com

坑2:

无法下载ceres-solver, 

修改.roinstall里面ceres-solver的源地址为https://github.com/ceres-solver/ceres-solver.git (不要使用该方法!!!见下面的内容)

- git: {local-name: cartographer, uri: 'https://github.com/googlecartographer/cartographer.git', version: '1.0.0'}
- git: {local-name: cartographer_ros, uri: 'https://github.com/googlecartographer/cartographer_ros.git', version: '1.0.0'}
- git: {local-name: ceres-solver, uri: 'https://github.com/ceres-solver/ceres-solver.git', version: '1.13.0'}

坑3:

在执行命令rosdep install --from-paths src --ignore-src -r -y 下载依赖包时遇到了如下的问题:

ERROR: Rosdep experienced an error: rosdep data for [version] must be a dictionary
Please go to the rosdep page [1] and file a bug report with the stack trace below.

Cartographer官方安装流程遇到的坑_第2张图片

处理方法:编辑lookup.py文件屏蔽该语句

sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/lookup.py

 

坑4:在编译(catkin_make_isolated --install --use-ninja)的过程中,出现如下的问题 

CMake Error at /home/ros/carto_ws/install_isolated/lib/cmake/Ceres/CeresConfig.cmake:88 (message):
  Failed to find Ceres - Missing requested Ceres components: [SuiteSparse]
  (components requested: [SuiteSparse]).  Detected Ceres version: 1.13.0
  installed in: /home/ros/carto_ws/install_isolated with components: [LAPACK,
  SchurSpecializations, OpenMP].
Call Stack (most recent call first):
  /home/ros/carto_ws/install_isolated/lib/cmake/Ceres/CeresConfig.cmake:392 (ceres_report_not_found)
  CMakeLists.txt:32 (find_package)

 

解决方法:当时我尝试手动编译Ceres没问题,但是使用catkin_make的时候就会失败,而且在catkin_make编译Ceres时没有使用SuiteSparse,当时尝试改过CMAKE文件,依然不行,最后我怀疑是由于ceres源的原因,因为我将官方指定的Ceres源由https://ceres-solver.googlesource.com/ceres-solver.git改为https://github.com/ceres-solver/ceres-solver.git ,所以只能借助代理下载ceres-solver安装包,并手动解压放置在src目录下。目录结构如下:

Cartographer官方安装流程遇到的坑_第3张图片

文件地址我已经上传到了CSDN:https://download.csdn.net/download/tracylining/12496279 

你可能感兴趣的:(SLAM)