How koide3/glim works
Project Type and Purpose
• GLIM is an open‐source, full‐featured 3D range‐based mapping framework written in C++.
• It comprises a core mapping engine (factor‐graph based, GTSAM integration), preprocessing and odometry modules, an interactive viewer, and extension points for plugins (ROS/ROS2, GPU acceleration, custom callbacks).
File Structure Analysis
• Top‐level:
• /glim – public headers (common, preprocess, odometry, mapping, viewer, util)
• src/glim – implementation files mirroring the include tree
• config – JSON configuration presets for sensors, odometry, mapping, viewer
• docker – Dockerfiles for building on various toolchains
• cmake, CMakeLists.txt – build system
• docs – user and developer documentation
• thirdparty – bundled nlohmann::json
• Patterns:
• Module‐based layering: preprocess → odometry → mapping → viewer
• Plugin mechanism via util/extension_module (ROS, ROS2)
• Factor‐graph back‐end (GTSAM) abstracted under mapping and odometry
Key README Insights
• Emphasizes accuracy (GTSAM, GPU), interactivity (viewer editing, loop closing), and extensibility (callback slots, extension modules).
• Lists mandatory dependencies (Eigen, nanoflann, GTSAM, gtsam_points) and optional ones (CUDA, OpenCV, ROS/ROS2).
a. Main Components
• Sensor Input (LiDAR, RGB‐D, etc.)
• Preprocessor Component
• Odometry Component
• Mapping Component (factor‐graph engine)
• Viewer Component (interactive editor, offline/standard viewers)
• Configuration Loader Component
• Extension Modules (ROS, ROS2, custom callbacks)
• Thirdparty Libraries (Eigen, nanoflann, GTSAM, gtsam_points, nlohmann::json)
b. Relationships and Data Flow
• Sensor Input → Preprocessor (cloud deskewing, filtering)
• Preprocessor → Odometry & Mapping (stream frames)
• Odometry & Mapping ↔ GTSAM Engine (insert factors, optimize)
• Mapping ↔ Extension Modules (global callback slots)
• Optimized Map Data → Viewer (render, edit, manual loop close)
• Configuration Loader → All Core Components (JSON parameters)
• Viewer → Mapping (on‐the‐fly corrections)
c. Architectural Patterns
• Layered pipeline: preprocess → odometry → mapping → viewer
• Plugin‐based extensibility via util/extension_module
• Asynchronous modules: async_odometry_estimation, async_global_mapping
• GPU acceleration paths (odometry_gpu, mapping GPU factors)
d. Technologies and Frameworks
• CMake, Docker for build/deploy
• Eigen, nanoflann for linear algebra and nearest‐neighbor searches
• GTSAM + gtsam_points for factor graphs
• CUDA (optional) for GPU modules
• ROS/ROS2 adapters under util/extension_module_ros
• nlohmann::json for config parsing