This repository contains a deterministic variant of ORB_SLAM2 that modifies the components that introduce non-determinism in the algorithm. The deterministic version aims to provide consistent and repeatable results across different runs. Additionally, we've made extra modifications, including the ability to compile ORB-SLAM2 without Pangolin, save the trajectory as a collection of frame poses in monocular mode, and updating dependencies to their latest versions."
Alejandro Fontan, Javier Civera and Michael Milford. Motion-Bias-Free Feature-Based SLAM. The British Machine Vision Conference, BMVC 2023. PDF.
C++17, OpenCV 4.7.0, Eigen 3.4.0 and Pangolin 0.8
- Sorted Functions: We've modified sort functions to ensure deterministic behavior when two or more elements are equal.
- Deterministic Random Integer Generator: Implemented a deterministic random integer generator that produces a predefined list of random integers at the start of execution, preventing conflicts with other processes using
rand()
. - C++ Standard Library Map: Introduced an Observation Class to avoid non-deterministic effects arising from memory allocation of std::map using pointers as key.
- Sequential ORB-SLAM2: We've modified the tracking, mapping, and loop closure threads to operate sequentially, eliminating non-deterministic effects associated with real-time performance.
COMPILE_SEQUENTIAL Activate this option to run a version of ORB-SLAM2 where the tracking and mapping threads run sequentially and are not affected by real-time effects.
COMPILE_DETERMINISTIC Activate this option
COMPILE_WITH_PANGOLIN Deactivate this option to run ORB-SLAM2 without compiling Pangolin.
#include <unistd.h>
in System.h- Fixed the code in LoopClosing.h:
typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
Eigen::aligned_allocator<std::pair<KeyFrame* const, g2o::Sim3> > > KeyFrameAndPose;
- Compiled without Pangolin
- Graph SLAM: Introduced a Graph SLAM Class to manage keyframes, enabling the saving of frame poses in monocular mode.
The deterministic version of ORB-SLAM2 in this fork has only been tested in monocular mode.
Link to the original ORB-SLAM2 repository https://github.com/raulmur/ORB_SLAM2