VINS_Fusion 编译运行碰到的问题

eigen 3.3.7

ceres 1.14.0

编译

编译ceres时

Could not find a configuration file for package "Eigen3" that is compatible  with requested version "3.3".

解决:把ceres版本调整到1.14.x

/usr/include/eigen3/Eigen/src/Core/MathFunctions.h: In instantiation of ‘static NewType Eigen::internal::cast_impl::run(const OldType&) [with OldType = ceres::Jet; NewType = int]’:
/usr/include/eigen3/Eigen/src/Core/MathFunctions.h:375:42:   required from ‘NewType Eigen::internal::cast(const OldType&) [with OldType = ceres::Jet; NewType = int]’
/usr/include/eigen3/Eigen/src/Core/IO.h:136:32:   required from ‘static int Eigen::internal::significant_decimals_default_impl::run() [with Scalar = ceres::Jet; bool IsInteger = false]’
/usr/include/eigen3/Eigen/src/Core/IO.h:183:66:   required from ‘std::ostream& Eigen::internal::print_matrix(std::ostream&, const Derived&, const Eigen::IOFormat&) [with Derived = Eigen::Matrix, 6, 1, 0, 6, 1>; std::ostream = std::basic_ostream]’
/usr/include/eigen3/Eigen/src/Core/IO.h:248:32:   required from ‘std::ostream& Eigen::operator<<(std::ostream&, const Eigen::DenseBase&) [with Derived = Eigen::Map, 6, 1, 0, 6, 1>, 0, Eigen::Stride<0, 0> >; std::ostream = std::basic_ostream]’
/home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/estimator/../initial/../factor/odom_factor.h:30:19:   required from ‘bool OdomFactor::operator()(const T*, const T*, T*) const [with T = ceres::Jet]’
/usr/local/include/ceres/internal/variadic_evaluate.h:166:19:   required from ‘static bool ceres::internal::VariadicEvaluate::Call(const Functor&, const T* const*, T*) [with Functor = OdomFactor; T = ceres::Jet; int N0 = 7; int N1 = 7]’
/usr/local/include/ceres/internal/autodiff.h:289:72:   required from ‘static bool ceres::internal::AutoDiff::Differentiate(const Functor&, const T* const*, int, T*, T**) [with Functor = OdomFactor; T = double; int N0 = 7; int N1 = 7; int N2 = 0; int N3 = 0; int N4 = 0; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
/usr/local/include/ceres/autodiff_cost_function.h:211:66:   required from ‘bool ceres::AutoDiffCostFunction::Evaluate(const double* const*, double*, double**) const [with CostFunctor = OdomFactor; int kNumResiduals = 6; int N0 = 7; int N1 = 7; int N2 = 0; int N3 = 0; int N4 = 0; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
/home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/estimator/estimator.cpp:1762:1:   required from here
/usr/include/eigen3/Eigen/src/Core/MathFunctions.h:365:34: error: invalid static_cast from type ‘const ceres::Jet’ to type ‘int’
     return static_cast(x);
                                  ^
In file included from /home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/initial/../factor/odom_factor.h:12:0,
                 from /home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/initial/initial_alignment.h:20,
                 from /home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/initial/initial_aligment.cpp:12:
/home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/initial/../factor/integration_odom_base.h: In constructor ‘IntegrationOdomBase::IntegrationOdomBase(const Vector3d&, const Vector3d&)’:
/home/cjn/1ros_workspace/VINS_Fusion_Odom/src/VINS-Fusion/vins_estimator/src/initial/../factor/integration_odom_base.h:79:25: warning: variable ‘T_CI’ set but not used [-Wunused-but-set-variable]
         Eigen::Matrix4d T_CI = T_IC.inverse();
                         ^
make[2]: *** [CMakeFiles/vins_lib.dir/src/estimator/estimator.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
make[1]: *** [CMakeFiles/vins_lib.dir/all] Error 2
make: *** [all] Error 2

eigen 版本问题,需要3.3.7

sudo apt-get install libeigen3-dev 路径 /usr/include/eigen3/  (默认使用路径)

源码编译路径 /usr/local/include/eigen3/ (版本是正确的,但是没起作用)

apt-cache policy libeigen3-dev
sudo apt install libeigen3-dev=3.3~beta1-2
sudo apt install libeigen3-dev=3.3.7-1~ubuntu16.04.1~ppa1
sudo apt install vim aptitude

运行

VINS_Fusion 编译运行碰到的问题_第1张图片

解决
1、删掉编译文件重新编译,若不行,尝试步骤2
2、camera_models包和vins_estimator包,CMakeLists文件加上
find_package(OpenCV 3.3.1 REQUIRED)
message(WARNING "OpenCV_VERSION: ${OpenCV_VERSION}")
删掉编译文件重新编译

原因:可能是opencv2.4版本和opencv3.3版本发生了冲突  

你可能感兴趣的:(SLAM)