LIO-SAM LVI-SAM编译

问题1:fatal error: opencv/cv.h: No such file or directory

原因1:在opencv4中opencv2的cv.h融合进了imgproc.hpp里,所以把源码中的#include <opencv/cv.h>改成#include <opencv2/imgproc.hpp>即可

解决1:

#include <opencv/cv.h>
改为#include <opencv2/imgproc.hpp>
或者#include <opencv2/opencv.hpp>

 

问题2:error: conversion from ‘std::shared_ptr<gtsam::PreintegrationParams>’ to non-scalar type ‘boost::shared_ptr<gtsam::PreintegrationParams>’ requested

解决2:

boost::shared_ptr<gtsam::PreintegrationParams> p = gtsam::PreintegrationParams::MakeSharedU(imuGravity);
改成
auto p = gtsam::PreintegrationParams::MakeSharedU(imuGravity);

 

问题3:error: reference to ‘Vector’ is ambiguous

解决3:

Vector(6)
改成
gtsam::Vector(6)