MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / PreSave

Method PreSave

src/MapPoint.cc:572–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void MapPoint::PreSave(set<KeyFrame*>& spKF,set<MapPoint*>& spMP)
573{
574 mBackupReplacedId = -1;
575 if(mpReplaced && spMP.find(mpReplaced) != spMP.end())
576 mBackupReplacedId = mpReplaced->mnId;
577
578 mBackupObservationsId1.clear();
579 mBackupObservationsId2.clear();
580 // Save the id and position in each KF who view it
581 for(std::map<KeyFrame*,std::tuple<int,int> >::const_iterator it = mObservations.begin(), end = mObservations.end(); it != end; ++it)
582 {
583 KeyFrame* pKFi = it->first;
584 if(spKF.find(pKFi) != spKF.end())
585 {
586 mBackupObservationsId1[it->first->mnId] = get<0>(it->second);
587 mBackupObservationsId2[it->first->mnId] = get<1>(it->second);
588 }
589 else
590 {
591 EraseObservation(pKFi);
592 }
593 }
594
595 // Save the id of the reference KF
596 if(spKF.find(mpRefKF) != spKF.end())
597 {
598 mBackupRefKFId = mpRefKF->mnId;
599 }
600}
601
602void MapPoint::PostLoad(map<long unsigned int, KeyFrame*>& mpKFid, map<long unsigned int, MapPoint*>& mpMPid)
603{

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected