安装运行cartographer,包括古月居给的代码踩坑经历

安装运行cartographer,包括古月居给的代码踩坑经历

  1. Cartographer安装教程
    这里就不搬运了,大家自己去看链接: https://blog.csdn.net/weixin_44684139/article/details/104708387
    说一说要注意的几点:
    1 一定要先把准备工作做好,卸载ros自带proto2再安装protobuf3.6.0
    2 安装cartographer在加入cartographer_ros.rosinstall并更新依赖时,总之就是要把
sudo gedit carto_ws/src/.rosinstall

中的下载链接设置有cartographer、cartographer_ros和ceres-solver,也就是最终会下载这三个文件夹,这里的链接不重要,重要的编译时会报错

– 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.

所以在编译前需要运行

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

来安装absl
3 设置环境变量的时候,直接把

source ~/carto_ws/install_isolated/setup.bash

加到 ~/.bashrc中
2.古月居rplidar.lua代码问题

主要是运行这两句命令

roslaunch mrobot_gazebo mrobot_laser_nav_gazebo.launch
roslaunch cartographer_ros cartographer_demo_rplidar.launch

不管怎样最后会报错,大致错误就是

[FATAL] [1603933857.368484527]: F1029 09:10:57.000000 6041 lua_parameter_dictionary.cc:83] Check failed: status == 0 (2 vs. 0) [string “-- Copyright 2016 The Cartographer Authors…”]:80: attempt to index global ‘SPARSE_POSE_GRAPH’ (a nil value)
*** Check failure stack trace: ***
@ 0x7fa2a70df46d google::LogMessage::Fail()
@ 0x7fa2a70e1a23 google::LogMessage::SendToLog()
@ 0x7fa2a70deffb google::LogMessage::Flush()
@ 0x7fa2a70e096e google::LogMessageFatal::~LogMessageFatal()
@ 0x6215c9 cartographer::common::(anonymous namespace)::CheckForLuaErrors()
@ 0x621dad cartographer::common::LuaParameterDictionary::LuaParameterDictionary()
@ 0x6220cd cartographer::common::LuaParameterDictionary::LuaParameterDictionary()
@ 0x5c26d1 cartographer_ros::LoadOptions()
@ 0x59083b cartographer_ros::(anonymous namespace)::Run()
@ 0x58dfa4 main
@ 0x7fa2a2f96830 __libc_start_main
@ 0x590559 _start
[cartographer_node-2] process has died [pid 1039, exit code -6, cmd /home/zyh/catkin_ctg/install_isolated/lib/cartographer_ros/cartographer_node -configuration_directory /home/zyh/catkin_ctg/install_isolated/share/cartographer_ros/configuration_files -configuration_basename revo_lds.lua scan:=scan __name:=cartographer_node __log:=/home/zyh/.ros/log/91b1ffc0-400d-11e9-9569-00e04c982253/cartographer_node-2.log].
log file: /home/zyh/.ros/log/91b1ffc0-400d-11e9-9569-00e04c982253/cartographer_node-2*.log

之类的,问题就在于新版本的cartographer的SPARSE_POSE_GRAPH更名为POSE_GRAPH了,但是仅仅在rplidar.lua中改这个依然有问题,直接将revo_lds.lua的内容复制然后修改 tracking_frame = “horizontal_laser_link”, published_frame = “horizontal_laser_link”,为

  tracking_frame = "laser_link",
  published_frame = "laser_link",

另外每次修改.lua和.launch文件都要重新编译carto_ws

  • 5
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 8
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值