ROS-melodic+cartographer+move_base

本文介绍如何通过二进制包快速安装cartographer,解决编译问题,包括依赖安装、测试步骤,以及在工作空间中编译遇到的CMake错误及解决方案,涉及lua和move_base配置实例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、安装cartographer

         99%的博客都教你用源码安装,例如    这样  ,但是我通过这一行命令解决了

sudo apt-get install ros-melodic-cartographer*

一般不会报错,报错了就是少依赖,按照错误信息去安装就可以。这样是2进制安装,可以正常使用,但不能修改编译源码。

二、测试cartographer

     1.下载.bag文件    链接: https://pan.baidu.com/s/18r_iJsACfouUXVyqBIazNw 提取码: iesg

     2.roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/lwh/cartographer/cartographer_paper_deutsches_museum.bag(按照自己的下载位置,定位到该.bag文件即可)

三、在工作空间中编译

     在测试无误后,在工作空间内编译却无法通过。

第一个错:

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "cartographer" with
  any of the following names:

    cartographerConfig.cmake
    cartographer-config.cmake

解决方案,将/opt/ros/melodic/share/cartographer目录下的cartographer-config.cmake复制到该目录下的cmake里。

第二个错:

CMake Error at /opt/ros/melodic/share/cartographer/cmake/cartographer-config.cmake:31 (message):
  File or directory /opt/ros/melodic/share/share/cartographer/cmake
  referenced by variable CARTOGRAPHER_CMAKE_DIR does not exist !

解决方案,/opt/ros/melodic/share/cartographer/cmake/cartographer-config.cmake第47行改为set_and_check(CARTOGRAPHER_CMAKE_DIR "${PACKAGE_PREFIX_DIR}/cartographer/cmake")

三、carto+move_base  (抽时间更)

3.1配置cartographer

3.1.1   .lua文件

3.1.1   .launch文件

3.2配置move_base   使用

3.2.1 .launch文件

3.2.2 .yaml文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

CPU疼

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值