Skip to content

Commit

Permalink
Fixed #1227
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Mar 3, 2024
1 parent 33b875e commit 8019a2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion corelib/src/Rtabmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ bool Rtabmap::process(
// Landmark
//============================================================
std::map<int, std::set<int> > landmarksDetected; // <Landmark ID, list of nodes that saw this landmark>
if(!signature->getLandmarks().empty())
if(!signature->getLandmarks().empty() && !_graphOptimizer->landmarksIgnored())
{
bool hasGlobalLoopClosuresInOdomCache = !graph::filterLinks(_odomCacheConstraints, Link::kGlobalClosure, true).empty() || _loopClosureHypothesis.first != 0;
UDEBUG("hasGlobalLoopClosuresInOdomCache=%d", hasGlobalLoopClosuresInOdomCache?1:0);
Expand Down Expand Up @@ -3527,6 +3527,7 @@ bool Rtabmap::process(
}

// update localization links
UASSERT(uContains(optPoses, signature->id()));
Transform newOptPoseInv = optPoses.at(signature->id()).inverse();
for(std::multimap<int, Link>::iterator iter=localizationLinks.begin(); iter!=localizationLinks.end(); ++iter)
{
Expand All @@ -3539,6 +3540,7 @@ bool Rtabmap::process(
else
{
// Adjust with optimized poses, this will smooth the localization
UASSERT(uContains(optPoses, iter->first));
Transform newT = newOptPoseInv * optPoses.at(iter->first);
UDEBUG("Adjusted localization link %d->%d after optimization", iter->second.from(), iter->second.to());
UDEBUG("from %s", iter->second.transform().prettyPrint().c_str());
Expand Down

0 comments on commit 8019a2d

Please sign in to comment.