g2o_solver.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * Copyright (c) 2017, Saurav Agarwal
4 * All rights reserved.
5 *
6 *********************************************************************/
7 
8 
9 #ifndef KARTO_G2OSolver_H
10 #define KARTO_G2OSolver_H
11 
12 #include <karto_sdk/Mapper.h>
13 #include "g2o/core/sparse_optimizer.h"
14 
15 namespace solver_plugins
16 {
17 
21 class G2OSolver : public karto::ScanSolver
22 {
23  public:
24 
25  G2OSolver();
26 
27  virtual ~G2OSolver();
28 
29  public:
30 
35  virtual void Clear();
36 
41  virtual void Compute();
42 
48  virtual const karto::ScanSolver::IdPoseVector& GetCorrections() const;
49 
57 
65 
72  void getGraph(std::vector<Eigen::Vector2d>& nodes); // std::vector<std::pair<Eigen::Vector2d, Eigen::Vector2d> > &edges);
73 
80  void useRobustKernel(bool flag)
81  {
82  useRobustKernel_ = flag;
83  }
84 
85  virtual void ModifyNode(const int& unique_id, const Eigen::Vector3d& pose); // change a node's pose
86 
87  private:
88 
90 
91  g2o::SparseOptimizer optimizer_;
92 
93  int latestNodeID_; // ID of the latest added node, this is used internally in AddHeadingConstraint
94 
95  bool useRobustKernel_;
96 
97 };
98 
99 }
100 
101 #endif // KARTO_G2OSolver_H
102 
karto::ScanSolver
Definition: Mapper.h:947
solver_plugins::G2OSolver::Compute
virtual void Compute()
Solve the SLAM back-end.
Definition: g2o_solver.cpp:77
solver_plugins::G2OSolver::~G2OSolver
virtual ~G2OSolver()
Definition: g2o_solver.cpp:55
solver_plugins::G2OSolver::G2OSolver
G2OSolver()
Definition: g2o_solver.cpp:39
solver_plugins::G2OSolver::latestNodeID_
int latestNodeID_
Definition: g2o_solver.hpp:103
solver_plugins::G2OSolver::Clear
virtual void Clear()
Clear the vector of corrections.
Definition: g2o_solver.cpp:65
karto::ScanSolver::IdPoseVector
std::vector< std::pair< kt_int32s, Pose2 > > IdPoseVector
Definition: Mapper.h:953
solver_plugins::G2OSolver::AddConstraint
virtual void AddConstraint(karto::Edge< karto::LocalizedRangeScan > *pEdge)
Add an edge constraint to pose-graph.
Definition: g2o_solver.cpp:141
solver_plugins::G2OSolver::AddNode
virtual void AddNode(karto::Vertex< karto::LocalizedRangeScan > *pVertex)
Add a node to pose-graph.
Definition: g2o_solver.cpp:125
solver_plugins::G2OSolver::optimizer_
g2o::SparseOptimizer optimizer_
Definition: g2o_solver.hpp:101
solver_plugins::G2OSolver::useRobustKernel
void useRobustKernel(bool flag)
Use robust kernel in back-end.
Definition: g2o_solver.hpp:90
solver_plugins::G2OSolver::corrections_
karto::ScanSolver::IdPoseVector corrections_
Definition: g2o_solver.hpp:99
solver_plugins::G2OSolver::useRobustKernel_
bool useRobustKernel_
Definition: g2o_solver.hpp:105
karto::Vertex< karto::LocalizedRangeScan >
solver_plugins::G2OSolver::GetCorrections
virtual const karto::ScanSolver::IdPoseVector & GetCorrections() const
Get the vector of corrections.
Definition: g2o_solver.cpp:71
Mapper.h
solver_plugins
Definition: ceres_solver.cpp:14
karto::ScanSolver::getGraph
virtual std::unordered_map< int, Eigen::Vector3d > * getGraph()
Definition: Mapper.h:1026
solver_plugins::G2OSolver::ModifyNode
virtual void ModifyNode(const int &unique_id, const Eigen::Vector3d &pose)
karto::Edge
Definition: Mapper.h:247


slam_toolbox
Author(s): Steve Macenski
autogenerated on Thu Jan 11 2024 03:37:55