SLAMAlign.hpp
Go to the documentation of this file.
1 
35 #ifndef SLAMALIGN_HPP_
36 #define SLAMALIGN_HPP_
37 
38 #include "SLAMScanWrapper.hpp"
39 #include "SLAMOptions.hpp"
40 #include "GraphSLAM.hpp"
41 
42 namespace lvr2
43 {
44 
48 class SLAMAlign
49 {
50 
51 public:
60  SLAMAlign(const SLAMOptions& options, const std::vector<SLAMScanPtr>& scans, std::vector<bool> new_scans = std::vector<bool>());
61 
67  SLAMAlign(const SLAMOptions& options = SLAMOptions(), std::vector<bool> new_scans = std::vector<bool>());
68 
69  virtual ~SLAMAlign() = default;
70 
79  void addScan(const SLAMScanPtr& scan, bool match = false);
80 
89  void addScan(const ScanPtr& scan, bool match = false);
90 
96  SLAMScanPtr scan(size_t index) const;
97 
108  void match();
109 
115  void finish();
116 
125  void setOptions(const SLAMOptions& options);
126 
136  SLAMOptions& options();
137 
141  const SLAMOptions& options() const;
142 
143 protected:
144 
146  void reduceScan(const SLAMScanPtr& scan);
147 
149  void applyTransform(SLAMScanPtr scan, const Matrix4d& transform);
150 
152  void checkLoopClose(size_t last);
153 
155  void loopClose(size_t first, size_t last);
156 
158  void graphSLAM(size_t last);
159 
161 
166  void checkLoopCloseOtherOrder(size_t last);
167 
175  void createIcpGraph();
176 
178 
179  std::vector<SLAMScanPtr> m_scans;
180 
182 
186 
187  std::vector<bool> m_new_scans;
188 
189  std::vector<std::pair<int, int>> m_icp_graph;
190 };
191 
192 } /* namespace lvr2 */
193 
194 #endif /* SLAMALIGN_HPP_ */
void setOptions(const SLAMOptions &options)
Sets the SLAMOptions struct to the parameter.
Definition: SLAMAlign.cpp:62
Wrapper class for running GraphSLAM on Scans.
Definition: GraphSLAM.hpp:61
void first(int id)
Definition: example.cpp:7
void loopClose(size_t first, size_t last)
Closes a simple Loop between first and last.
Definition: SLAMAlign.cpp:312
void checkLoopClose(size_t last)
Checks for and executes any loopcloses that occur.
Definition: SLAMAlign.cpp:269
void checkLoopCloseOtherOrder(size_t last)
checkLoopClose(size_t last) if the m_icp_graph is in a spezial order
Definition: SLAMAlign.cpp:228
SLAMOptions & options()
Returns a reference to the internal SLAMOptions struct.
Definition: SLAMAlign.cpp:67
SLAMOptions m_options
Definition: SLAMAlign.hpp:177
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Definition: ScanTypes.hpp:98
SLAMScanPtr scan(size_t index) const
Returns a shared_ptr to a Scan.
Definition: SLAMAlign.cpp:93
A struct to configure SLAMAlign.
Definition: SLAMOptions.hpp:45
void createIcpGraph()
Create m_icp_graph which defined the order of registrations.
Definition: SLAMAlign.cpp:385
std::vector< std::pair< int, int > > m_icp_graph
Definition: SLAMAlign.hpp:189
std::vector< bool > m_new_scans
Definition: SLAMAlign.hpp:187
std::vector< SLAMScanPtr > m_scans
Definition: SLAMAlign.hpp:179
void graphSLAM(size_t last)
Executes GraphSLAM up to and including the specified last Scan.
Definition: SLAMAlign.cpp:364
virtual ~SLAMAlign()=default
GraphSLAM m_graph
Definition: SLAMAlign.hpp:183
void finish()
Indicates that no new Scans will be added.
Definition: SLAMAlign.cpp:369
A class to run SLAM on Scans.
Definition: SLAMAlign.hpp:48
void addScan(const SLAMScanPtr &scan, bool match=false)
Adds a new Scan to the SLAM instance.
Definition: SLAMAlign.cpp:77
Eigen::Matrix4d Matrix4d
Eigen 4x4 matrix, double precision.
std::shared_ptr< SLAMScanWrapper > SLAMScanPtr
void reduceScan(const SLAMScanPtr &scan)
Applies all reductions to the Scan.
Definition: SLAMAlign.cpp:98
SLAMScanPtr m_metascan
Definition: SLAMAlign.hpp:181
SLAMAlign(const SLAMOptions &options, const std::vector< SLAMScanPtr > &scans, std::vector< bool > new_scans=std::vector< bool >())
Creates a new SLAMAlign instance with the given Options and Scans.
void match()
Executes SLAM on all current Scans.
Definition: SLAMAlign.cpp:125
void applyTransform(SLAMScanPtr scan, const Matrix4d &transform)
Applies the Transformation to the specified Scan and adds a frame to all other Scans.
Definition: SLAMAlign.cpp:207


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:09