一、编译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运行结果