- Preparation: download openCV 3.4+ and PCL, Eigen3, Ceres, g2o, and other necessary libraries
- Step 1: download the dataset from TUM website above, then put it into
[$repo_folder]/data/rgb_pngand[$repo_folder]/data/depth_png, along with thedata/rgb.txt, anddata/depth.txtfor dataset index. (The code about how to extract images and depths data are written in slamBase.h, you can change the path there) - Step 2: build and compile the code
mkdir build
cd build
cmake ..
make- Step3: run the code in /bin folder:
./bin/visualOdometry
/src has the main source files.
slamBase.cpphas most self-defined functions to compute keyPoints and Descriptors, estimate Motion, join point clouds and so on.visualOdometry.cppimplemented the VO.slamEnd.cppintegrated the G2O library for optimization.slam.cppimproved based onslamEndandvo, by adding keyFrames extraction and check_loop_closure. It is the complete version based on the above steps, yet still has some bugs.
- core dump at some frames
- some wierd DTL algorithm bugs:
DLT algorithm needs at least 6 points for pose estimation from 3D-2D point correspondences.
(expected: 'count >= 6'),
where'count' is 5- too many consecutive
not enough inliers, maybe the distance between the frames are too far.
solving PnP
inliers: 0
inliers not enough, abandoning this frame