mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 09:07:47 +08:00
Memory::computeTransform(): removed setting guess to identity if input guess is null
This commit is contained in:
+6
-14
@@ -2138,10 +2138,14 @@ Transform Memory::computeTransform(
|
||||
// Remove descriptors, this will avoid recomputation of the correspondences in regVis
|
||||
tmpFrom.setWordsDescriptors(std::multimap<int, cv::Mat>());
|
||||
tmpTo.setWordsDescriptors(std::multimap<int, cv::Mat>());
|
||||
guess = regVis.computeTransformation(tmpFrom, tmpTo, guess, info);
|
||||
Transform t = regVis.computeTransformation(tmpFrom, tmpTo, guess, info);
|
||||
// set back descriptors
|
||||
tmpFrom.setWordsDescriptors(fromS.getWordsDescriptors());
|
||||
tmpTo.setWordsDescriptors(toS.getWordsDescriptors());
|
||||
if(!t.isNull())
|
||||
{
|
||||
guess = t;
|
||||
}
|
||||
}
|
||||
|
||||
if(_reextractLoopClosureFeatures)
|
||||
@@ -2157,24 +2161,13 @@ Transform Memory::computeTransform(
|
||||
tmpTo.sensorData().setFeatures(std::vector<cv::KeyPoint>(), cv::Mat());
|
||||
}
|
||||
|
||||
if(guess.isNull())
|
||||
{
|
||||
if(!_registrationPipeline->isImageRequired())
|
||||
if(guess.isNull() && !_registrationPipeline->isImageRequired())
|
||||
{
|
||||
UDEBUG("");
|
||||
// no visual in the pipeline, make visual registration for guess
|
||||
guess = regVis.computeTransformation(tmpFrom, tmpTo, guess, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
UDEBUG("");
|
||||
guess.setIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
if(!guess.isNull())
|
||||
{
|
||||
UDEBUG("");
|
||||
transform = _registrationPipeline->computeTransformation(tmpFrom, tmpTo, guess, info);
|
||||
|
||||
if(!transform.isNull())
|
||||
@@ -2198,7 +2191,6 @@ Transform Memory::computeTransform(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return transform;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ Transform Registration::computeTransformationMod(
|
||||
}
|
||||
else if(!guess.isNull())
|
||||
{
|
||||
// This registration approach failed, continue with the guess for the next registration
|
||||
UDEBUG("This registration approach failed, continue with the guess for the next registration");
|
||||
t = child_->computeTransformationMod(from, to, guess, &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1017,7 +1017,7 @@ bool Rtabmap::process(
|
||||
//============================================================
|
||||
if(!signature->sensorData().laserScanCompressed().empty())
|
||||
{
|
||||
UINFO("Odometry refining");
|
||||
UINFO("Odometry refining: guess = %s", guess.prettyPrint().c_str());
|
||||
RegistrationInfo info;
|
||||
Transform t = _memory->computeTransform(oldId, signature->id(), guess, &info);
|
||||
if(!t.isNull())
|
||||
|
||||
Reference in New Issue
Block a user