diff --git a/Examples/Stereo/stereo_kitti.cc b/Examples/Stereo/stereo_kitti.cc index cb8bc4096e..07dc53eac7 100644 --- a/Examples/Stereo/stereo_kitti.cc +++ b/Examples/Stereo/stereo_kitti.cc @@ -75,6 +75,12 @@ int main(int argc, char **argv) cerr << endl << "Failed to load image at: " << string(vstrImageLeft[ni]) << endl; return 1; + } + else if(imRight.empty()) + { + cerr << endl << "Failed to load image at: " + << string(vstrImageRight[ni]) << endl; + return 1; } #ifdef COMPILEDWITHC11 diff --git a/README.md b/README.md index acf42ee7e0..3d026ff4bf 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ This will create **libORB_SLAM2.so** at *lib* folder and the executables **mono 1. Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php -2. Execute the following command. Change `KITTIX.yaml`by KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11. +2. Execute the following command. Change `KITTIX.yaml`by `KITTI00-02.yaml`, `KITTI03.yaml` or `KITTI04-12.yaml` for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11. ``` ./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER ``` diff --git a/src/Tracking.cc b/src/Tracking.cc index 2273b2ce48..6505540d0d 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -539,11 +539,7 @@ void Tracking::StereoInitialization() cout << "New map created with " << mpMap->MapPointsInMap() << " points" << endl; - mpLocalMapper->InsertKeyFrame(pKFini); - - mLastFrame = Frame(mCurrentFrame); - mnLastKeyFrameId=mCurrentFrame.mnId; - mpLastKeyFrame = pKFini; + mpLocalMapper->InsertKeyFrame(pKFini); mvpLocalKeyFrames.push_back(pKFini); mvpLocalMapPoints=mpMap->GetAllMapPoints(); @@ -555,6 +551,10 @@ void Tracking::StereoInitialization() mpMap->mvpKeyFrameOrigins.push_back(pKFini); mpMapDrawer->SetCurrentCameraPose(mCurrentFrame.mTcw); + + mLastFrame = Frame(mCurrentFrame); + mnLastKeyFrameId=mCurrentFrame.mnId; + mpLastKeyFrame = pKFini; mState=OK; }