激光slam学习笔记4--slam_in_autonomous_driving编译碰到问题汇总

news/2024/9/28 3:56:41/

背景:项目需要,学习一些imu姿态估计知识。从组长那边借来高翔新作:自动驾驶与机器人中的slam技术,仔细看一看。环境,ubuntu20.04。

一、资料准备

课本对应的代码
一些依赖,首先参考github上对应的readme介绍安装

二、踩到的坑

报错1:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CHOLMOD_LIBRARYlinked by target "run_gins_pre_integ" in directory /home/ylh/code_ws/slam_in_autonomous_driving/src/ch4

解决方式:

sudo apt install libcholmod3 libsuitesparse-dev

报错2:

/home/ylh/code_ws/slam_in_autonomous_driving/thirdparty/g2o/g2o/core/openmp_mutex.h:30:10: fatal error: g2o/config.h: No such file or directory30 | #include "g2o/config.h"

解决方式:

将thirdparty/g2o/build/g2o/config.h拷贝到thirdparty/g20/目录下

报错3:

fatal error: velodyne_msgs/VelodyneScan.h: No such file or directory18 | #include "velodyne_msgs/VelodyneScan.h"

解决方式:

sudo apt install ros-noetic-velodyne-msgs安装消息依赖

报错4:

make[2]: *** No rule to make target 'gmock', needed by '../bin/test_nn'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:4227: src/ch5/CMakeFiles/test_nn.dir/all] Error 2

解决方式:
修改ch4、ch5对应的cmakelists.txt:
ch4:

# 查找 Google Test,它应该也包含了 Google Mock
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})# 添加您的库
add_library(${PROJECT_NAME}.ch4gins_pre_integ.ccimu_preintegration.ccg2o_types.cc
)# 添加您的测试可执行文件
add_executable(test_preintegration test_preintegration.cc)# 链接 Google Test (它应该包含了 gmock) 以及其他依赖项
target_link_libraries(test_preintegration${GTEST_LIBRARIES}pthread glog gflags ${PROJECT_NAME}.ch4 ${PROJECT_NAME}.ch3 ${PROJECT_NAME}.common
)# 添加测试
add_test(NAME test_preintegration COMMAND test_preintegration)# 添加其他可执行文件
add_executable(run_gins_pre_integ run_gins_pre_integ.cc)
target_link_libraries(run_gins_pre_integ${PROJECT_NAME}.ch3${PROJECT_NAME}.ch4${G2O_LIBS}
)

ch5:

find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})add_executable(point_cloud_load_and_vis point_cloud_load_and_vis.cc)
target_link_libraries(point_cloud_load_and_vis${PCL_LIBRARIES}${GLOG_LIBRARIES}gflags)add_executable(pcd_to_bird_eye pcd_to_bird_eye.cc)
target_link_libraries(pcd_to_bird_eye${PCL_LIBRARIES}${GLOG_LIBRARIES}${OpenCV_LIBS}gflags)add_executable(scan_to_range_image scan_to_range_image.cc)
target_link_libraries(scan_to_range_image${PCL_LIBRARIES}${GLOG_LIBRARIES}${OpenCV_LIBS}gflags)add_library(${PROJECT_NAME}.ch5bfnn.cckdtree.ccocto_tree.cc)
target_link_libraries(${PROJECT_NAME}.ch5tbb)add_executable(linear_fitting linear_fitting.cc)
target_link_libraries(linear_fitting${PCL_LIBRARIES}${GLOG_LIBRARIES}${OpenCV_LIBS}gflags)ADD_EXECUTABLE(test_nn test_nn.cc)
ADD_TEST(test_nn test_bfnn)target_link_libraries(test_nngtest pthread glog gflags ${PROJECT_NAME}.ch5 ${PROJECT_NAME}.common ${PCL_LIBRARIES} tbb)

参考

三、小结

1、thirdparty目录下,对g2o、livox_ros_driver、Pangolin进行:

mkdir build && cd build
cmake .. && make

其他包没有进行编译操作

###################
好记性不如烂笔头
积跬步期千里


http://www.ppmy.cn/news/1530949.html

相关文章

基于SpringBoot+Vue+MySQL的特色旅游网站系统

系统展示 用户前台界面 管理员后台界面 系统背景 随着旅游业的蓬勃发展,人们对旅游体验的需求日益多样化与个性化。传统的旅游信息查询与预订方式已难以满足现代游客的需求。因此,我们开发了这款基于SpringBootVueMySQL的特色旅游网站系统。该系统旨在通…

数据结构-3.1.栈的基本概念

一.栈的定义: 栈和线性表的区别:栈只能在表尾一端进行插入或者删除的操作,而线性表可以在任意一个地方进行插入或者删除 二.有关栈的关键术语: 三.栈的基本操作: 1.回顾线性表的基本操作: 2.栈的基本操作&…

【Python报错已解决】TypeError: can only concatenate str (not “int“) to str

🎬 鸽芷咕:个人主页 🔥 个人专栏: 《C干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 专栏介绍 在软件开发和日常使用中,BUG是不可避免的。本专栏致力于为广大开发者和技术爱好者提供一个关于BUG解决的经…

金融领域的人工智能——Palmyra-Fin 如何重新定义市场分析

引言 DigiOps与人工智能 正在改变全球各行各业,并带来新的创新和效率水平。人工智能已成为金融领域的强大工具,为市场分析、风险管理和决策带来了新方法。金融市场以复杂性和快速变化而闻名,人工智能处理大量数据并提供清晰、可操作的见解的…

[笔记]数据结构

文章目录 堆排序215 数组中第k个最大元素 堆排序 堆排序方法对于记录数较少的文件并不值得提倡,但对n较大的文件还是有效 运行时间主要耗费在: 建立初始堆调整建立新堆 反复筛选 筛选算法进行的关键字比较次数至多为: 2 ( k − 1 ) 2(k-1)…

FPGA题目记录2

1、下列总线中属于AMBA总线的是:(D) A、SPI B、PCIe C、I2C D、ASB AMBA是由ARM公司研发推出的一种高级微控制器总线架构(Advanced Microcontroller Bus Architecture)。其中AMBA包含了四种不同的总线标准,分别是:AHB…

WPF DataGrid 动态修改某一个单元格的样式

WPF DataGrid 动态修改某一个单元格的样式 <DataGrid Name"main_datagrid_display" Width"1267" Height"193" Grid.Column"1"ItemsSource"{Binding DataGridModels}"><DataGrid.Columns><!--ElementStyle 设…

解决在Nignx下Thinkphp路由不生效问题

Nignx下Tp框架路由不生效 问题的原因在于ThinkPHP通过URL后缀匹配方法&#xff0c;默认没有后缀会尝试访问默认的index方法。 解决方案&#xff1a;在URL末尾添加/后缀或者修改路由配置文件route.php中的规则。 如果还是没解决建议换apache