Fixed FATAL error for link variance == 0 on loop closure of two identical images

This commit is contained in:
matlabbe
2015-09-08 23:18:12 -04:00
parent d425d84ce2
commit 5dcbb66a6d
+1 -1
View File
@@ -1790,7 +1790,7 @@ bool Rtabmap::process(
if(!rejectedHypothesis) if(!rejectedHypothesis)
{ {
// Make the new one the parent of the old one // Make the new one the parent of the old one
rejectedHypothesis = !_memory->addLink(Link(signature->id(), _loopClosureHypothesis.first, Link::kGlobalClosure, transform, variance, variance)); rejectedHypothesis = !_memory->addLink(Link(signature->id(), _loopClosureHypothesis.first, Link::kGlobalClosure, transform, variance>0?variance:0.0001, variance>0?variance:0.0001));
if(!rejectedHypothesis) if(!rejectedHypothesis)
{ {
loopClosureLinksAdded.push_back(std::make_pair(signature->id(), _loopClosureHypothesis.first)); loopClosureLinksAdded.push_back(std::make_pair(signature->id(), _loopClosureHypothesis.first));