Skip to content

Commit

Permalink
Localization mode: Fixed proximity detection permanently disabled whe…
Browse files Browse the repository at this point in the history
…n Rtabmap/StartNewMapOnLoopClosure is true
  • Loading branch information
matlabbe committed Jun 28, 2023
1 parent a1168ba commit 97be9d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion corelib/src/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ std::map<int, Transform> findNearestPoses(
{
foundPoses.insert(*poses.find(iter->first));
}
UDEBUG("found nodes=%d", (int)foundPoses.size());
UDEBUG("found nodes=%d/%d (radius=%f, angle=%f, k=%d)", (int)foundPoses.size(), (int)poses.size(), radius, angle, k);
return foundPoses;
}

Expand Down
12 changes: 11 additions & 1 deletion corelib/src/Rtabmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,8 @@ bool Rtabmap::process(
{
if(_startNewMapOnLoopClosure &&
_memory->getWorkingMem().size()>=2 && // must have an old map (+1 virtual place)
graph::filterLinks(signature->getLinks(), Link::kSelfRefLink).size() == 0) // alone in new session)
_localizationCovariance.empty() && // if we didn't localize yet
graph::filterLinks(signature->getLinks(), Link::kSelfRefLink).size() == 0) // alone in new session
{
UINFO("Proximity detection by space disabled as if we force to have a global loop "
"closure with previous map before doing proximity detections (%s=true).",
Expand Down Expand Up @@ -2695,6 +2696,15 @@ bool Rtabmap::process(
}
}
}
else if(!signature->hasLink(nearestId) && proximityFilteringRadius>0.0f)
{
UDEBUG("Skipping path %d as most likely ID %d is too far %f > %f (%s)",
iter->first.id,
nearestId,
_optimizedPoses.at(signature->id()).getDistance(_optimizedPoses.at(nearestId)),
proximityFilteringRadius,
Parameters::kRGBDProximityPathFilteringRadius().c_str());
}
}
}

Expand Down

0 comments on commit 97be9d4

Please sign in to comment.