/slam

Simplest implementation of Simultaneous Localisation and Mapping with Brute-force matching of necessary points. Visualized and optimized using Pangolin and g2o libraries of C++ respectively, build for python.

Primary LanguagePython

slam

Simplest implementation of Simultaneous Localisation and Mapping using-

  1. OpenCV-Python for 2D display and feature extraction.
  2. Pangolin for 3D mapping.
  3. g2o (python) for optimisation of mapping.

output on a test video

The focal length needs to be passed as the parameter F in bash shell along with the user's video directory. Moreover, a 'yes' or 'no' parameter has to be passed depending on the user's requirement of using a reverse SLAM.

example command :

python3 slam.py F=500 PATH=videos/test_vid.mp4 REVERSE=n

OR,

python3 slam.py 500 videos/test_vid.mp4 n

To exit the program press 'q' on the 'frames' window.

To install Pangolin and g2o follow the tutorial on their github repository. Make sure you have the dependencies that are listed, installed on your machine.

TODOS:

  1. Add kinemtic model, becomes shitty later on. Fine initially though.
  2. Add g2o optimization only to latest pose and not all the previous ones, which probably makes it slower and worse in the future.
  3. Add optimizer for Focal length (different for different camera lens).
  4. Deploy on Windows, Mac as well.

Might encounter Cholesky errors in certain iterations but it fixes itself. Currently usably fast.

Will keep updating. Check commits for history.