How mavis-slam/openmavis works
Project type and purpose
• Type: Native C++ library + command-line and ROS executables for Visual-Inertial SLAM.
Major subsystems (to represent as top-level “blocks”)
A. Input / Data Acquisition
• Sensor Drivers & Readers
• Examples folder contains demo executables for Monocular, Stereo, RGB-D, Multi-Inertial, etc.
• ROS nodes (optional) under Examples/ROS.
• Preprocessor
• Image rectification (online/offline), timestamp alignment (evaluation scripts).
• IMU pre-integration module (include/ImuTypes, src/ImuTypes.cc).
B. Front-End Tracking
• Feature Extraction: ORBextractor (include/ORBextractor, src/ORBextractor.cc).
• Feature Matching: ORBmatcher (include/ORBmatcher, src/ORBmatcher.cc).
• Pose Estimation & Frame Integration: src/Tracking.cc, handles multi-camera pose via geometric camera models (include/CameraModels/…).
C. Map Management
• Points (include/MapPoint, src/MapPoint.cc), KeyFrames (include/KeyFrame, src/KeyFrame.cc), Map database (include/KeyFrameDatabase, src/KeyFrameDatabase.cc).
• Local Mapping thread (include/LocalMapping, src/LocalMapping.cc).
• Loop Closing thread (include/LoopClosing, src/LoopClosing.cc).
D. Back-End Optimization
• IMU pre-integration & optimization (SE2(3) formulation).
• Graph optimization using modified g2o (Thirdparty/g2o).
• Pose graph solver (include/Optimizer, src/Optimizer.cc).
• Sim3 solver for scale loop closure (include/Sim3Solver, src/Sim3Solver.cc).
E. Database & Place Recognition
• Vocabulary & Bag-of-Words (Vocabulary/ORBvoc.txt, Thirdparty/DBoW2).
• Enables relocalization and loop detection.
F. Visualization & Output
• Pangolin-based viewer (include/Viewer, src/Viewer.cc).
• FrameDrawer, MapDrawer (include/FrameDrawer, include/MapDrawer).
• Trajectory output and evaluation scripts (evaluation/).
G. Configuration & Build
• CMakeLists.txt, build scripts (build.sh, build_ros.sh).
• Settings files (*.yaml in Examples/**).
Interactions and data flow
1) Sensors → Preprocessor
• Images + IMU → camera model rectification, timestamp sync.
2) Preprocessor → Front-End
• Undistorted images fed to ORB feature extractor.
• IMU measurements passed to IMU pre-integration.
3) Front-End ↔ Map Database
• Tracks features → proposes new KeyFrames → stores in Map.
4) Front-End → Back-End
• Feeds KeyFrames & IMU factors to optimizer.
5) Back-End → Map Database
• Adjusts poses & map points (global BA, loop closure).
6) Map Database → Visualization
• Updated map & camera poses rendered.
7) Database → Place Recognition
• Loop detection queries Bag-of-Words database.
8) Optional ROS Interface
• Wrap the above as ROS nodes → topics/services.
Architectural patterns & design principles
• Modular threads: tracking, local mapping, loop closing, optimization, rendering run in parallel.
• Front-End / Back-End decoupling: real-time tracking vs. batch graph optimization.
• Plug-in sensors: easily swap Monocular / Stereo / RGB-D / Multi-camera modules by selecting the proper Example executable and YAML.
• Third-party isolation: DBoW2, g2o, Eigen, Pangolin, OpenCV are isolated in Thirdparty or via CMake.
Be as detailed as necessary
• Threads or modules (Tracking, LocalMapping, LoopClosing, Viewer).
• Configuration files (.yaml) feeding into examples.
• Essential architectural elements—don’t worry about minor utility classes.