mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Fixed not optimized map from first node if we switch RGBD/OptimizeFromGraphEnd parameter on and off while mapping.
This commit is contained in:
@@ -2059,6 +2059,15 @@ bool Rtabmap::process(
|
||||
|
||||
UINFO("Update map correction");
|
||||
std::map<int, Transform> poses = _optimizedPoses;
|
||||
|
||||
// if _optimizeFromGraphEnd parameter just changed state, don't use optimized poses as guess
|
||||
float normMapCorrection = _mapCorrection.getNormSquared(); // use distance for identity detection
|
||||
if((normMapCorrection > 0.001f && _optimizeFromGraphEnd) ||
|
||||
(normMapCorrection < 0.001f && !_optimizeFromGraphEnd))
|
||||
{
|
||||
poses.clear();
|
||||
}
|
||||
|
||||
std::multimap<int, Link> constraints;
|
||||
optimizeCurrentMap(signature->id(), false, poses, &constraints, &optimizationError, &optimizationIterations);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user