当使用g2o进行前段优化的时候发现make完成的g2o包无法找到,在CMakeLists.txt文件中也已经配置好了,却出现如下问题:

2018-05-10 17-33-19屏幕截图.png
显示无法定位g2o文件位置。
阅读了g2o中的readme文件又重新安装了一遍依赖项,发现还是无法定位。
再次看到上图的log信息发现,可能需要在camke_module文件夹中加入FindG2O文件来定位。
加入的文件内容如下:
# Find the header files
FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
${G2O_ROOT}/include
$ENV{G2O_ROOT}/include
$ENV{G2O_ROOT}
/usr/local/include
/usr/include
/opt/local/include
/sw/local/include
/sw/include
NO_DEFAULT_PATH
)
# Macro to unify finding both the debug and release versions of the
# libraries; this is adapted from