错误1
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:745:3: error: static assertion failed:
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
修改三方库的G2O包
打开Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h,将以下代码
1 template <typename MatrixType>
2 class LinearSolverEigen: public LinearSolver<MatrixType>
3 {
4 public:
5 typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
6 typedef Eigen::Triplet<double> Triplet;
7 typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
改成
1 template <typename MatrixType>
2 class LinearSolverEigen: public LinearSolver<MatrixType>
3 {
4 public:
5 typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
6 typedef Eigen::Triplet<double> Triplet;
8 typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;
错误2
Could NOT find CHOLMOD (missing: CHOLMOD_INCLUDE_DIR CHOLMOD_LIBRARIES)
添加相关依赖
sudo apt-get install libsuitesparse-dev