Ubuntu 18.04 安装cartographer

环境:Ubuntu 18.04
ROS:Melodic

1.安装所有依赖

sudo apt-get install -y google-mock libboost-all-dev  libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx  ros-melodic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

2. 安装ceres-solver,随意路径

安装ceres-solver时,如安装低版本或者高版本都会出现不兼容而报错的现象,解决方法如下:

安装[seres-solver-1.13.0],此操作可能需要梯子(https://ceres-solver.googlesource.com/ceres-solver/+/refs/tags/1.13.0)
点击图中按钮下载:[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Ak44k94B-1610967069869)(1.png)]
下载完后,解压->新建build文件夹

$ cd ceres-solver-1.13.0/ build
$ cmake ..
$ make –j
$ sudo make install

3.安装cartographer,也是随意路径

$ git clone https://github.com/cartographer-project/cartographer.git
$ cd cartographer/build
$ cmake ..
$ make
$ sudo make install

安装时会出现以下问题:编译时出现缺少absl包

-- Found GMock: gmock_main;-lpthread
CMake Error at CMakeLists.txt:32 (find_package):
By not providing "Findabsl.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "absl", but
CMake did not find one.

Could not find a package configuration file provided by "absl" with any of
the following names:

abslConfig.cmake
absl-config.cmake

Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
"absl_DIR" to a directory containing one of the above files. If "absl"
provides a separate development package or SDK, be sure it has been
installed.

解决方法

下载cartographer上有安装absl的脚本,装完后再次运行上面的安装程序。

$ sudo apt-get install stow
$ sudo chmod +x ~/catkin_ws/src/cartographer/scripts/install_abseil.sh
$ cd ~/catkin_ws/src/cartographer/scripts
$ ./install_abseil.sh

4.安装cartographer_ros

$ git clone https://github.com/cartographer-project/cartographer_ros.git

然后到catkin_ws下运行catkin_make即可。

5.官方数据下载测试,搭了梯子很快:

2d数据500M

3d数据8G左右

然后运行launch文件即可。

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/mckros/cartographer_paper_deutsches_museum.bag

效果如下:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-28mzWC74-1610967069872)(2.png)]

3d数据没有测试:

roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=/home/mckros/cartographer_3d_deutsches_museum.bag

Reference:

  1. https://www.cnblogs.com/hitcm/p/5939507.html
  • 1
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

锡城筱凯

你的鼓励是我创造的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值