- 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_png
and[$repo_folder]/data/depth_png
, along with thedata/rgb.txt
, anddata/depth.txt
for 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.cpp
has most self-defined functions to compute keyPoints and Descriptors, estimate Motion, join point clouds and so on.visualOdometry.cpp
implemented the VO.slamEnd.cpp
integrated the G2O library for optimization.slam.cpp
improved based onslamEnd
andvo
, 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