g2o 初始化
阅读原文时间:2023年07月13日阅读:2

typedef g2o::BlockSolver< g2o::BlockSolverTraits<,> > Block; // pose 维度为 6, landmark 维度为 3
Block::LinearSolverType* linearSolver = new g2o::LinearSolverCSparse(); // 线性方程求解器
Block* solver_ptr = new Block( std::unique_ptr(linearSolver) ); // 矩阵块求解器
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(std::unique_ptr(solver_ptr) );
g2o::SparseOptimizer optimizer;
optimizer.setAlgorithm ( solver );
optimizer.setVerbose( true );

typedef g2o::BlockSolver< g2o::BlockSolverTraits<,> > Block;  // pose维度为 6, landmark 维度为 3  
Block::LinearSolverType\* linearSolver = new g2o::LinearSolverEigen<Block::PoseMatrixType>(); // 线性方程求解器  
Block\* solver\_ptr = new Block( **std::unique\_ptr<Block::LinearSolverType>(linearSolver)** );      // 矩阵块求解器  
g2o::OptimizationAlgorithmGaussNewton\* solver = new g2o::OptimizationAlgorithmGaussNewton( **std::unique\_ptr<Block::LinearSolverType>****(linearSolver)** );  
g2o::SparseOptimizer optimizer;  
optimizer.setAlgorithm( solver );

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章