Skip to content

Commit

Permalink
Update System.cc
Browse files Browse the repository at this point in the history
SaveTrajectory functions retrieve full frame trajectory using relative rigid body transformations between each frame and its reference keyframe. This relative transform is computed when the frame was tracked. This is inaccurate in the monocular case, as each relative transformation is computed at the particular scale when each frame was tracked. A global scale change will make all relative transformations invalid, and this can happen in two cases:
1) At loop closure
2) When the map is small and all keyframes are optimized in the Local BA. In that case the scale is not fixed and can change.
  • Loading branch information
raulmur authored Oct 27, 2016
1 parent 1656554 commit ab50979
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/System.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ void System::Shutdown()
void System::SaveTrajectoryTUM(const string &filename)
{
cout << endl << "Saving camera trajectory to " << filename << " ..." << endl;
if(mSensor==MONOCULAR)
{
cerr << "ERROR: SaveTrajectoryTUM cannot be used for monocular." << endl;
return;
}

vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();
sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
Expand Down Expand Up @@ -376,6 +381,11 @@ void System::SaveKeyFrameTrajectoryTUM(const string &filename)
void System::SaveTrajectoryKITTI(const string &filename)
{
cout << endl << "Saving camera trajectory to " << filename << " ..." << endl;
if(mSensor==MONOCULAR)
{
cerr << "ERROR: SaveTrajectoryKITTI cannot be used for monocular." << endl;
return;
}

vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();
sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
Expand Down

0 comments on commit ab50979

Please sign in to comment.