VINS_Fusion 编译运行碰到的问题

eigen 3.3.7

cmake -DCMAKE_INSTALL_PREFIX=/usr ..
sudo make install

ceres 1.14.0

http://www.ceres-solver.org/installation.html

编译

编译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<OldType, NewType>::run(const OldType&) [with OldType = ceres::Jet<double, 14>; NewType = int]’:
/usr/include/eigen3/Eigen/src/Core/MathFunctions.h:375:42:   required from ‘NewType Eigen::internal::cast(const OldType&) [with OldType = ceres::Jet<double, 14>; NewType = int]’
/usr/include/eigen3/Eigen/src/Core/IO.h:136:32:   required from ‘static int Eigen::internal::significant_decimals_default_impl<Scalar, IsInteger>::run() [with Scalar = ceres::Jet<double, 14>; 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<ceres::Jet<double, 14>, 6, 1, 0, 6, 1>; std::ostream = std::basic_ostream<char>]’
/usr/include/eigen3/Eigen/src/Core/IO.h:248:32:   required from ‘std::ostream& Eigen::operator<<(std::ostream&, const Eigen::DenseBase<Derived>&) [with Derived = Eigen::Map<Eigen::Matrix<ceres::Jet<double, 14>, 6, 1, 0, 6, 1>, 0, Eigen::Stride<0, 0> >; std::ostream = std::basic_ostream<char>]’
/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<double, 14>]’
/usr/local/include/ceres/internal/variadic_evaluate.h:166:19:   required from ‘static bool ceres::internal::VariadicEvaluate<Functor, T, N0, N1, 0, 0, 0, 0, 0, 0, 0, 0>::Call(const Functor&, const T* const*, T*) [with Functor = OdomFactor; T = ceres::Jet<double, 14>; int N0 = 7; int N1 = 7]’
/usr/local/include/ceres/internal/autodiff.h:289:72:   required from ‘static bool ceres::internal::AutoDiff<Functor, T, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::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<CostFunctor, kNumResiduals, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::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<double, 14>’ to type ‘int’
     return static_cast<NewType>(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

运行

解决
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版本发生了冲突  
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值