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 
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_ */
lvr2::SLAMAlign::m_scans
std::vector< SLAMScanPtr > m_scans
Definition: SLAMAlign.hpp:179
lvr2::SLAMAlign::m_foundLoop
bool m_foundLoop
Definition: SLAMAlign.hpp:184
lvr2::SLAMAlign::reduceScan
void reduceScan(const SLAMScanPtr &scan)
Applies all reductions to the Scan.
Definition: SLAMAlign.cpp:98
transform
Definition: src/tools/lvr2_transform/Options.cpp:44
lvr2::SLAMAlign::m_loopIndexCount
int m_loopIndexCount
Definition: SLAMAlign.hpp:185
lvr2::SLAMAlign::applyTransform
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
SLAMScanWrapper.hpp
lvr2::SLAMAlign::m_new_scans
std::vector< bool > m_new_scans
Definition: SLAMAlign.hpp:187
lvr2::SLAMAlign::~SLAMAlign
virtual ~SLAMAlign()=default
lvr2::SLAMAlign::m_metascan
SLAMScanPtr m_metascan
Definition: SLAMAlign.hpp:181
lvr2::SLAMAlign::scan
SLAMScanPtr scan(size_t index) const
Returns a shared_ptr to a Scan.
Definition: SLAMAlign.cpp:93
lvr2::Matrix4d
Eigen::Matrix4d Matrix4d
Eigen 4x4 matrix, double precision.
Definition: MatrixTypes.hpp:150
lvr2::SLAMAlign::setOptions
void setOptions(const SLAMOptions &options)
Sets the SLAMOptions struct to the parameter.
Definition: SLAMAlign.cpp:62
lvr2::SLAMAlign::options
SLAMOptions & options()
Returns a reference to the internal SLAMOptions struct.
Definition: SLAMAlign.cpp:67
lvr2::SLAMAlign::loopClose
void loopClose(size_t first, size_t last)
Closes a simple Loop between first and last.
Definition: SLAMAlign.cpp:312
lvr2::SLAMAlign::checkLoopClose
void checkLoopClose(size_t last)
Checks for and executes any loopcloses that occur.
Definition: SLAMAlign.cpp:269
lvr2::SLAMScanPtr
std::shared_ptr< SLAMScanWrapper > SLAMScanPtr
Definition: SLAMScanWrapper.hpp:221
lvr2::SLAMAlign::match
void match()
Executes SLAM on all current Scans.
Definition: SLAMAlign.cpp:125
lvr2::SLAMAlign::checkLoopCloseOtherOrder
void checkLoopCloseOtherOrder(size_t last)
checkLoopClose(size_t last) if the m_icp_graph is in a spezial order
Definition: SLAMAlign.cpp:228
lvr2::SLAMAlign::m_options
SLAMOptions m_options
Definition: SLAMAlign.hpp:177
lvr2::SLAMAlign::graphSLAM
void graphSLAM(size_t last)
Executes GraphSLAM up to and including the specified last Scan.
Definition: SLAMAlign.cpp:364
lvr2::SLAMAlign::createIcpGraph
void createIcpGraph()
Create m_icp_graph which defined the order of registrations.
Definition: SLAMAlign.cpp:385
lvr2::SLAMAlign
A class to run SLAM on Scans.
Definition: SLAMAlign.hpp:48
SLAMOptions.hpp
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::SLAMAlign::SLAMAlign
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.
first
void first(int id)
Definition: example.cpp:7
lvr2::SLAMAlign::finish
void finish()
Indicates that no new Scans will be added.
Definition: SLAMAlign.cpp:369
lvr2::SLAMOptions
A struct to configure SLAMAlign.
Definition: SLAMOptions.hpp:45
lvr2::SLAMAlign::m_icp_graph
std::vector< std::pair< int, int > > m_icp_graph
Definition: SLAMAlign.hpp:189
lvr2::SLAMAlign::addScan
void addScan(const SLAMScanPtr &scan, bool match=false)
Adds a new Scan to the SLAM instance.
Definition: SLAMAlign.cpp:77
lvr2::SLAMAlign::m_graph
GraphSLAM m_graph
Definition: SLAMAlign.hpp:183
GraphSLAM.hpp
lvr2::GraphSLAM
Wrapper class for running GraphSLAM on Scans.
Definition: GraphSLAM.hpp:61
lvr2::ScanPtr
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Definition: ScanTypes.hpp:98


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 Wed Mar 2 2022 00:37:25