2019-10-07

2019-10-12  本文已影响0人  liampayne_66d0

1

修改g2o/types/slam2d/edge_se2_pointxy_bearing.cpp

t.setRotation(t.rotation().angle()+_measurement);

改为:

t.setRotation((Eigen::Rotation2Dd)(t.rotation().angle()+_measurement));

2忘了截图了,错误提示:

static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
修改g2o/solvers/eigen/linear_solver_eigen.h

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;

改为:

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::StorageIndex> PermutationMatrix;

3.

处理方法:
Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h的代码:

 template <typename MatrixType>
 class LinearSolverEigen: public LinearSolver<MatrixType>
 {
   public:
     typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
     typedef Eigen::Triplet<double> Triplet;
     typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;

修改为:

template <typename MatrixType>
class LinearSolverEigen: public LinearSolver<MatrixType>
 {
   public:
     typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
     typedef Eigen::Triplet<double> Triplet;
     typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix

g2o/g2o/examples/tutorial_slam2d/simulator.cpp:78的代码

    for (int i = 0; i < probLimits.size(); ++i)          
      probLimits[i] = (i + 1) / (double) MO_NUM_ELEMS;

修改成:

      VectorXd probLimits;
        probLimits.resize(MO_NUM_ELEMS);
        for (int i = 0; i < probLimits.size(); ++i)
          probLimits[i] = (i + 1) / (double) MO_NUM_ELEMS;
上一篇 下一篇

猜你喜欢

热点阅读