GraphSLAM.hpp
Go to the documentation of this file.
1 
34 #ifndef GRAPHSLAM_HPP_
35 #define GRAPHSLAM_HPP_
36 
37 #include "SLAMScanWrapper.hpp"
38 #include "SLAMOptions.hpp"
39 #include "KDTree.hpp"
40 
41 #include <Eigen/SparseCore>
42 
43 namespace lvr2
44 {
45 
56 bool findCloseScans(const std::vector<SLAMScanPtr>& scans, size_t scan, const SLAMOptions& options, std::vector<size_t>& output);
57 
61 class GraphSLAM
62 {
63 public:
64 
65  using GraphMatrix = Eigen::SparseMatrix<double>;
66  using GraphVector = Eigen::VectorXd;
67  using Graph = std::vector<std::pair<int, int>>;
68 
70 
71  virtual ~GraphSLAM() = default;
72 
80  void doGraphSLAM(const std::vector<SLAMScanPtr>& scans, size_t last, const std::vector<bool>& new_scans = std::vector<bool>()) const;
81 
82 protected:
89  void createGraph(const std::vector<SLAMScanPtr>& scans, size_t last, Graph& graph) const;
90 
98  void fillEquation(const std::vector<SLAMScanPtr>& scans, const Graph& graph, GraphMatrix& mat, GraphVector& vec) const;
99 
100  void eulerCovariance(KDTreePtr tree, SLAMScanPtr scan, Matrix6d& outMat, Vector6d& outVec) const;
101 
103 };
104 
105 } /* namespace lvr2 */
106 
107 #endif /* GRAPHSLAM_HPP_ */
GraphSLAM(const SLAMOptions *options)
Definition: GraphSLAM.cpp:117
void doGraphSLAM(const std::vector< SLAMScanPtr > &scans, size_t last, const std::vector< bool > &new_scans=std::vector< bool >()) const
runs the GraphSLAM algorithm
Definition: GraphSLAM.cpp:122
std::vector< std::pair< int, int > > Graph
Definition: GraphSLAM.hpp:67
void fillEquation(const std::vector< SLAMScanPtr > &scans, const Graph &graph, GraphMatrix &mat, GraphVector &vec) const
A function to fill the linear system mat * x = vec.
Definition: GraphSLAM.cpp:266
Wrapper class for running GraphSLAM on Scans.
Definition: GraphSLAM.hpp:61
const kaboom::Options * options
virtual ~GraphSLAM()=default
void eulerCovariance(KDTreePtr tree, SLAMScanPtr scan, Matrix6d &outMat, Vector6d &outVec) const
Definition: GraphSLAM.cpp:392
Eigen::VectorXd GraphVector
Definition: GraphSLAM.hpp:66
bool findCloseScans(const std::vector< SLAMScanPtr > &scans, size_t scan, const SLAMOptions &options, std::vector< size_t > &output)
finds Scans that are "close" to a Scan as determined by a Loopclosing strategy
void createGraph(const std::vector< SLAMScanPtr > &scans, size_t last, Graph &graph) const
Creates a graph. An edge between nodes(scans) means posible overlap.
Definition: GraphSLAM.cpp:243
A struct to configure SLAMAlign.
Definition: SLAMOptions.hpp:45
std::shared_ptr< KDTree > KDTreePtr
Definition: KDTree.hpp:135
Eigen::Matrix< double, 6, 6 > Matrix6d
6D matrix double precision
Eigen::Matrix< double, 6, 1 > Vector6d
6D vector double precision
std::shared_ptr< SLAMScanWrapper > SLAMScanPtr
Eigen::SparseMatrix< double > GraphMatrix
Definition: GraphSLAM.hpp:65
const SLAMOptions * m_options
Definition: GraphSLAM.hpp:102


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06