高翔:《自动驾驶与机器人中的SLAM技术 》-Slam_in_autonomous_driving 编译过程中遇到的问题

使用的环境是ubuntu20.04

问题1.安装g2o没有问题,不过在编译整个项目工程时候报错:

"openmp_mutex.h: 30:10: fatal error: g2o/config.h: No such file or directory":

解决办法:

复制代码
只需要将/thirdparty/g2o/build/g2o下的config.h放到/thirdparty/g2o下:

问题2. No rule to make target 'gmock',needed by '../bin/test_preintegration' . stop

src/ch4/CMakeFiles/test_preintegration.dir/all] Error 2:

解决办法:将/ch4/CmakeList.txt文件内容修改如下:

查找 Google Test,它应该也包含了 Google Mock

find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

添加您的库

add_library(${PROJECT_NAME}.ch4

gins_pre_integ.cc

imu_preintegration.cc

g2o_types.cc

)

添加您的测试可执行文件

add_executable(test_preintegration test_preintegration.cc)

链接 Google Test (它应该包含了 gmock) 以及其他依赖项

target_link_libraries(test_preintegration

${GTEST_BOTH_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}

问题3.No rule to make target 'gmock',needed by '../bin/test_nn' . stop

CMakeFiles/Makefile2:4227:src/ch5/CMakeFiles/test_nn.dir/all]

修改/ch5/CMakeList.txt 内容为:

find_package(GTest REQUIRED)

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}.ch5

bfnn.cc

kdtree.cc

octo_tree.cc

)

target_link_libraries(${PROJECT_NAME}.ch5

tbb

)

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(NAME test_nn COMMAND test_nn)

target_link_libraries(test_nn

GTest::GTest

GTest::Main

glog

gflags

${PROJECT_NAME}.ch5

${PROJECT_NAME}.common

${PCL_LIBRARIES}

tbb

参考博文:

https://blog.csdn.net/ht_lf/article/details/134185779

相关推荐
七月稻草人1 分钟前
CANN ops-nn:AIGC底层神经网络算力的核心优化引擎
人工智能·神经网络·aigc·cann
种时光的人2 分钟前
CANN仓库核心解读:ops-nn打造AIGC模型的神经网络算子核心支撑
人工智能·神经网络·aigc
晚霞的不甘4 分钟前
守护智能边界:CANN 的 AI 安全机制深度解析
人工智能·安全·语言模型·自然语言处理·前端框架
谢璞6 分钟前
中国AI最疯狂的一周:50亿金元肉搏,争夺未来的突围之战
人工智能
池央6 分钟前
CANN 算子生态的深度演进:稀疏计算支持与 PyPTO 范式的抽象层级
运维·人工智能·信号处理
方见华Richard7 分钟前
世毫九实验室(Shardy Lab)研究成果清单(2025版)
人工智能·经验分享·交互·原型模式·空间计算
Maynor9967 分钟前
OpenClaw 玩家必备:用 AI 自动追踪社区最新动态
java·服务器·人工智能
aini_lovee8 分钟前
MATLAB基于小波技术的图像融合实现
开发语言·人工智能·matlab
ujainu17 分钟前
CANN仓库中的AIGC多模态统一抽象工程:昇腾AI软件栈如何用一套接口驾驭图文音视
人工智能·aigc
AC赳赳老秦22 分钟前
代码生成超越 GPT-4:DeepSeek-V4 编程任务实战与 2026 开发者效率提升指南
数据库·数据仓库·人工智能·科技·rabbitmq·memcache·deepseek