| 600 | } |
| 601 | |
| 602 | void MapPoint::PostLoad(map<long unsigned int, KeyFrame*>& mpKFid, map<long unsigned int, MapPoint*>& mpMPid) |
| 603 | { |
| 604 | mpRefKF = mpKFid[mBackupRefKFId]; |
| 605 | if(!mpRefKF) |
| 606 | { |
| 607 | cout << "ERROR: MP without KF reference " << mBackupRefKFId << "; Num obs: " << nObs << endl; |
| 608 | } |
| 609 | mpReplaced = static_cast<MapPoint*>(NULL); |
| 610 | if(mBackupReplacedId>=0) |
| 611 | { |
| 612 | map<long unsigned int, MapPoint*>::iterator it = mpMPid.find(mBackupReplacedId); |
| 613 | if (it != mpMPid.end()) |
| 614 | mpReplaced = it->second; |
| 615 | } |
| 616 | |
| 617 | mObservations.clear(); |
| 618 | |
| 619 | for(map<long unsigned int, int>::const_iterator it = mBackupObservationsId1.begin(), end = mBackupObservationsId1.end(); it != end; ++it) |
| 620 | { |
| 621 | KeyFrame* pKFi = mpKFid[it->first]; |
| 622 | map<long unsigned int, int>::const_iterator it2 = mBackupObservationsId2.find(it->first); |
| 623 | std::tuple<int, int> indexes = tuple<int,int>(it->second,it2->second); |
| 624 | if(pKFi) |
| 625 | { |
| 626 | mObservations[pKFi] = indexes; |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | mBackupObservationsId1.clear(); |
| 631 | mBackupObservationsId2.clear(); |
| 632 | } |
| 633 | |
| 634 | } //namespace ORB_SLAM |