g2o
Functions
slam2d_g2o.cpp File Reference
#include <iostream>
#include "main_window.h"
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/factory.h"
#include "g2o/core/optimization_algorithm_gauss_newton.h"
#include "g2o/core/optimization_algorithm_levenberg.h"
#include "g2o/solvers/csparse/linear_solver_csparse.h"
#include <QApplication>
Include dependency graph for slam2d_g2o.cpp:

Go to the source code of this file.

Functions

 G2O_USE_TYPE_GROUP (slam2d)
 
int main (int argc, char **argv)
 

Function Documentation

G2O_USE_TYPE_GROUP ( slam2d  )
int main ( int  argc,
char **  argv 
)

Definition at line 36 of file slam2d_g2o.cpp.

References MainWindow::solverGaussNewton, MainWindow::solverLevenberg, and g2o::SparseOptimizer.

37 {
38  QApplication qapp(argc, argv);
39 
40  MainWindow mw;
41  mw.show();
42 
43  mw.viewer->graph = new SparseOptimizer();
44 
45  typedef BlockSolver< BlockSolverTraits<-1, -1> > SlamBlockSolver;
47 
48  SlamLinearSolver* linearSolver = new SlamLinearSolver();
49  linearSolver->setBlockOrdering(false);
50  SlamBlockSolver* blockSolver = new SlamBlockSolver(linearSolver);
51 
53  OptimizationAlgorithmLevenberg* solverLevenberg = new OptimizationAlgorithmLevenberg(blockSolver);
54  mw.solverGaussNewton = solverGauss;
55  mw.solverLevenberg = solverLevenberg;
56  mw.viewer->graph->setAlgorithm(solverGauss);
57 
58  return qapp.exec();
59 }
g2o::OptimizationAlgorithm * solverGaussNewton
Definition: main_window.h:35
Implementation of the Levenberg Algorithm.
traits to summarize the properties of the fixed size optimization problem
Definition: block_solver.h:43
Implementation of the Gauss Newton Algorithm.
linear solver which uses CSparse
class G2O_CORE_API SparseOptimizer
g2o::OptimizationAlgorithm * solverLevenberg
Definition: main_window.h:36
Implementation of a solver operating on the blocks of the Hessian.
Definition: block_solver.h:96
main window of the g2o viewer
Definition: main_window.h:40