Skip to content

Files

Latest commit

Jun 21, 2024
6a22335 · Jun 21, 2024

History

History

Monocular SLAM for Robotics implementation in python

Implementation of Monocular Visual SLAM in Python:

Setup pangolin for python:

Install pangolin python:

The original library is written in c++, but there is python binding available.

  • Install dependency: For Ubuntu/Debian execute the below commands to install library dependencies,
sudo apt-get install libglew-dev
sudo apt-get install cmake
sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev
sudo apt-get install libdc1394-22-dev libraw1394-dev
sudo apt-get install libjpeg-dev libpng-dev libtiff5-dev libopenexr-dev
  • Don't need to follow the Very Optional Dependencies from the repository.

  • Install the Library: Execute the below commands to install pangolin,

git clone https://github.com/uoip/pangolin.git
cd pangolin
mkdir build
cd build
cmake ..
make -j8
cd ..
python setup.py install

In the make -j8 you might get some error, just follow the comment mentioned in this github issue. Running the python setup.py install might throw an silly error, use this comment from the exact issue to solve this.

  • Other dependencies are pip installable.

How to run?

python main.py

Code structure:

├── display.py
├── extractor.py
├── pointmap.py
├── main.py
├── notebooks
│   ├── bundle_adjustment.ipynb
│   ├── mapping.ipynb
│   └── SLAM_pipeline_step_by_step.ipynb

In the notebook section we have shown how to run all the components of a monocular slam,

  • SLAM_pipeline_step_by_step.ipynb Describes the entire pipeline
  • mapping.ipynb is another resource for mapping source
  • bundle_adjustment.ipynb another great resource to understand g2o and bundle adjustment. source

1st notebook uses the kitti dataset (grayscale, 22 GB), download it from here.