视觉slam十四讲(第二版)之第七讲:pose_estimation_3d2d、pose_estimation_3d3d报错解决方案

一、编译pose_estimation_3d2d出现如下错误:

In file included from /usr/local/include/g2o/core/base_unary_edge.h:30:0,
from /home/zxh/Code/slambook2/ch7/pose_estimation_3d2d.cpp:8:
/usr/local/include/g2o/core/base_fixed_sized_edge.h:179:32: error: ‘index_sequence’ is not a member of ‘std’
struct HessianTupleType<std::index_sequence<Ints…>> {
^~~~~~~~~~~~~~
/usr/local/include/g2o/core/base_fixed_sized_edge.h:179:32: error: ‘index_sequence’ is not a member of ‘std’
/usr/local/include/g2o/core/base_fixed_sized_edge.h:179:51: error: expected parameter pack before ‘…’
struct HessianTupleType<std::index_sequence<Ints…>> {
解决办法:
修改CMAKELISTS里的11改14

set(CMAKE_CXX_FLAGS "-std=c++14 -O2 ${SSE_FLAGS} -msse4") 

二、未对fmt的引用
报错:
CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o:在函数‘fmt::v8::appender fmt::v8::detail::write<char, fmt::v8::appender>(fmt::v8::appender, fmt::v8::basic_string_view<fmt::v8::type_identity::type>, fmt::v8::basic_format_specs const&, fmt::v8::detail::locale_ref) [clone .isra.1468]’中:
pose_estimation_3d2d.cpp:(.text+0x466f):对‘fmt::v8::detail::basic_data::left_padding_shifts’未定义的引用
原因:
没有链接到fmt库

解决方法:
修改CMakeList.txt

target_link_libraries(orb_self ${OpenCV_LIBS})

改为

target_link_libraries(orb_self ${OpenCV_LIBS} fmt)

所有的都添加target_link_libraries后都添加
三、pose_estimation_3d2d运行结果
在这里插入图片描述pose_estimation_3d3d运行结果
在这里插入图片描述
在这里插入图片描述

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值