-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
To better understand how feature points impact pose estimation outcome, I have been logging ORB-SLAM3, running it with Stereo. I have modified the constructor below to log when the algorithm discovers the map point, noting the frame number (not the key frame) of the image sequence in which we discovered the map point.
MapPoint::MapPoint(const Eigen::Vector3f &Pos, KeyFrame pRefKF, Map pMap):
mnFirstKFid(pRefKF->mnId), mnFirstFrame(pRefKF->mnFrameId), nObs(0), mnTrackReferenceForFrame(0),
mnLastFrameSeen(0), mnBALocalForKF(0), mnFuseCandidateForKF(0), mnLoopPointForKF(0), mnCorrectedByKF(0),
mnCorrectedReference(0), mnBAGlobalForKF(0), mpRefKF(pRefKF), mnVisible(1), mnFound(1), mbBad(false),
mpReplaced(static_cast<MapPoint*>(NULL)), mfMinDistance(0), mfMaxDistance(0), mpMap(pMap),
mnOriginMapId(pMap->GetId())
{
SetWorldPos(Pos);
mNormalVector.setZero();
mbTrackInViewR = false;
mbTrackInView = false;
// MapPoints can be created from Tracking and Local Mapping. This mutex avoid conflicts with id.
unique_lock<mutex> lock(mpMap->mMutexPointCreation);
mnId=nNextId++;
std::ofstream logFile;
logFile.open("mappoint_log.txt", std::ios::app); // Open in append mode
if (logFile.is_open())
{
logFile << "[MapPoint Created] From KeyFrame " << pRefKF->mnId
<< " (frame " << pRefKF->mnFrameId << "), "
<< "assigned MapPoint ID: " << mnId << std::endl;
logFile.close();
}
else
{
std::cerr << "Unable to open mappoint_log.txt for writing!" << std::endl;
}
}
This lead me to some highly puzzling behaviour.
[MapPoint Created] From KeyFrame 107 (frame 2662), assigned MapPoint ID: 36912
[MapPoint Created] From KeyFrame 118 (frame 397), assigned MapPoint ID: 36912
So according this:
- ORB-SLAM3 first encounters map point 36912 in frame 2662 and adds to to its map points.
- Later, ORB-SLAM3 believes it first encountered map point 36912 in frame 397.
Am I logging the process incorrectly or is this some ORB-SLAM3 behaviour that I'm not aware of?