A class to run SLAM on Scans. More...
#include <SLAMAlign.hpp>
Public Member Functions | |
void | addScan (const ScanPtr &scan, bool match=false) |
Adds a new Scan to the SLAM instance. More... | |
void | addScan (const SLAMScanPtr &scan, bool match=false) |
Adds a new Scan to the SLAM instance. More... | |
void | finish () |
Indicates that no new Scans will be added. More... | |
void | match () |
Executes SLAM on all current Scans. More... | |
SLAMOptions & | options () |
Returns a reference to the internal SLAMOptions struct. More... | |
const SLAMOptions & | options () const |
Returns a reference to the internal SLAMOptions struct. More... | |
SLAMScanPtr | scan (size_t index) const |
Returns a shared_ptr to a Scan. More... | |
void | setOptions (const SLAMOptions &options) |
Sets the SLAMOptions struct to the parameter. More... | |
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. More... | |
SLAMAlign (const SLAMOptions &options=SLAMOptions(), std::vector< bool > new_scans=std::vector< bool >()) | |
Creates a new SLAMAlign instance with the given Options. More... | |
virtual | ~SLAMAlign ()=default |
Protected Member Functions | |
void | applyTransform (SLAMScanPtr scan, const Matrix4d &transform) |
Applies the Transformation to the specified Scan and adds a frame to all other Scans. More... | |
void | checkLoopClose (size_t last) |
Checks for and executes any loopcloses that occur. More... | |
void | checkLoopCloseOtherOrder (size_t last) |
checkLoopClose(size_t last) if the m_icp_graph is in a spezial order More... | |
void | createIcpGraph () |
Create m_icp_graph which defined the order of registrations. More... | |
void | graphSLAM (size_t last) |
Executes GraphSLAM up to and including the specified last Scan. More... | |
void | loopClose (size_t first, size_t last) |
Closes a simple Loop between first and last. More... | |
void | reduceScan (const SLAMScanPtr &scan) |
Applies all reductions to the Scan. More... | |
Protected Attributes | |
bool | m_foundLoop |
GraphSLAM | m_graph |
std::vector< std::pair< int, int > > | m_icp_graph |
int | m_loopIndexCount |
SLAMScanPtr | m_metascan |
std::vector< bool > | m_new_scans |
SLAMOptions | m_options |
std::vector< SLAMScanPtr > | m_scans |
A class to run SLAM on Scans.
Definition at line 48 of file SLAMAlign.hpp.
lvr2::SLAMAlign::SLAMAlign | ( | const SLAMOptions & | options, |
const std::vector< SLAMScanPtr > & | scans, | ||
std::vector< bool > | new_scans = std::vector< bool >() |
||
) |
lvr2::SLAMAlign::SLAMAlign | ( | const SLAMOptions & | options = SLAMOptions() , |
std::vector< bool > | new_scans = std::vector<bool>() |
||
) |
Creates a new SLAMAlign instance with the given Options.
options | The Options to use |
Definition at line 57 of file SLAMAlign.cpp.
|
virtualdefault |
void lvr2::SLAMAlign::addScan | ( | const ScanPtr & | scan, |
bool | match = false |
||
) |
void lvr2::SLAMAlign::addScan | ( | const SLAMScanPtr & | scan, |
bool | match = false |
||
) |
|
protected |
Applies the Transformation to the specified Scan and adds a frame to all other Scans.
Definition at line 207 of file SLAMAlign.cpp.
|
protected |
Checks for and executes any loopcloses that occur.
Definition at line 269 of file SLAMAlign.cpp.
|
protected |
checkLoopClose(size_t last) if the m_icp_graph is in a spezial order
same as checkLoopClose(size_t last) but if the m_icp_graph is in a spezial order
Same as checkLoopClose(size_t last) but if the m_icp_graph is in a spezial order.
Definition at line 228 of file SLAMAlign.cpp.
|
protected |
Create m_icp_graph which defined the order of registrations.
Create m_icp_graph which defined the order of registrations. The first scan is regarded as registered. Then the scan that is closest to one of the already matched scans is always added. Therefore the scan centers were compared using Euclidean distance.
Definition at line 385 of file SLAMAlign.cpp.
void lvr2::SLAMAlign::finish | ( | ) |
Indicates that no new Scans will be added.
This method ensures that all Scans are properly registered, including any Loopclosing
Definition at line 369 of file SLAMAlign.cpp.
|
protected |
Executes GraphSLAM up to and including the specified last Scan.
Definition at line 364 of file SLAMAlign.cpp.
|
protected |
Closes a simple Loop between first and last.
Definition at line 312 of file SLAMAlign.cpp.
void lvr2::SLAMAlign::match | ( | ) |
Executes SLAM on all current Scans.
This methods registers any new Scans added since the last call to match() (or the creation of this instance) using Scanmatching and Loopclosing, as specified by the SLAMOptions.
Calling this method several times without adding any new Scans has no additional effect after the first call.
Definition at line 125 of file SLAMAlign.cpp.
const SLAMOptions & lvr2::SLAMAlign::options | ( | ) |
Returns a reference to the internal SLAMOptions struct.
This can be used to make changes to specific values within the SLAMOptions without replacing the entire struct.
Note that changing options on an active SLAMAlign instance with previously added / matched Scans can cause Undefined Behaviour.
Definition at line 67 of file SLAMAlign.cpp.
const SLAMOptions& lvr2::SLAMAlign::options | ( | ) | const |
Returns a reference to the internal SLAMOptions struct.
|
protected |
Applies all reductions to the Scan.
Definition at line 98 of file SLAMAlign.cpp.
SLAMScanPtr lvr2::SLAMAlign::scan | ( | size_t | index | ) | const |
Returns a shared_ptr to a Scan.
index | The index of the Scan |
Definition at line 93 of file SLAMAlign.cpp.
void lvr2::SLAMAlign::setOptions | ( | const SLAMOptions & | options | ) |
Sets the SLAMOptions struct to the parameter.
Note that changing options on an active SLAMAlign instance with previously added / matched Scans can cause Undefined Behaviour.
options | The new options |
Definition at line 62 of file SLAMAlign.cpp.
|
protected |
Definition at line 184 of file SLAMAlign.hpp.
|
protected |
Definition at line 183 of file SLAMAlign.hpp.
|
protected |
Definition at line 189 of file SLAMAlign.hpp.
|
protected |
Definition at line 185 of file SLAMAlign.hpp.
|
protected |
Definition at line 181 of file SLAMAlign.hpp.
|
protected |
Definition at line 187 of file SLAMAlign.hpp.
|
protected |
Definition at line 177 of file SLAMAlign.hpp.
|
protected |
Definition at line 179 of file SLAMAlign.hpp.