Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS "append" function #1303

Open
EvanZhang0710 opened this issue Jun 17, 2024 · 1 comment
Open

IOS "append" function #1303

EvanZhang0710 opened this issue Jun 17, 2024 · 1 comment

Comments

@EvanZhang0710
Copy link

I understand that the IOS rtabmap uses loop detection to realize the "append" function. I want to play around with the "append" function and integrate new features into it. However, I am kind of confused about which file and which code chunk specifically implements this. Any suggestions?

Thanks!

@matlabbe
Copy link
Member

The "append" mode is implicitly handled with the loop closure detector and by setting Rtabmap/StartNewMapOnLoopClosure parameter to true (set here for mobile apps) to avoid adding new data to database before a loop closure is accepted with a previous map inside it. For each new image, we update the Bayes filter for loop closure detection, and in case of Append mode, we aggressively try to close the loop on the highest hypothesis (on the mobile app _aggressiveLoopThr is zero):

// use the best hypothesis directly.
UDEBUG("Using %s=%f", Parameters::kRGBDAggressiveLoopThr().c_str(), _aggressiveLoopThr);
loopThr = _aggressiveLoopThr;

Computation of the loop closure constraint happens here:

//=============================================================
// Global loop closure detection
// (updated: place this after retrieval to be sure that neighbors of the loop closure are in RAM)
//=============================================================
if(_loopClosureHypothesis.first>0)
{
if(loopIdSuppressedByProximity==0)
{
//Compute transform if metric data are present
Transform transform;
RegistrationInfo info;
info.covariance = cv::Mat::eye(6,6,CV_64FC1);
if(_rgbdSlamMode)
{
transform = _memory->computeTransform(
_loopClosureHypothesis.first,
signature->id(),
_loopClosureIdentityGuess?Transform::getIdentity():Transform(),
&info);

If a constraint is found, rtabmap will start to appends new data to the database, otherwise the new image is discarded:

if(_startNewMapOnLoopClosure &&
_memory->isIncremental() && // only in mapping mode
graph::filterLinks(signature->getLinks(), Link::kSelfRefLink).size() == 0 && // alone in the current map
(landmarksDetected.empty() || rejectedLandmark) && // if we re not seeing a landmark from a previous map
_memory->getWorkingMem().size()>=2) // The working memory should not be empty (beside virtual signature)
{
UWARN("Ignoring location %d because a global loop closure is required before starting a new map!",
signature->id());
signaturesRemoved.push_back(signature->id());
_memory->deleteLocation(signature->id());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants