How 93won/lidar_odometry works
Project Type & Purpose
• This is a native C++17 real-time LiDAR odometry/SLAM application (not a web app or microservice) that implements feature‐based ICP registration, sliding‐window and pose‐graph optimization (PKO/PGO), and 3D visualization for KITTI & MID360 datasets.
High-Level Architecture from File Structure & README
• Top-level “app/”: two CLI executables (kitti_lidar_odometry, mid360_lidar_odometry) plus dataset players under app/player/.
• “config/”: YAML files for dataset paths and algorithm parameters.
• “src/”: core modules, divided into
• database/ (LidarFrame store)
• processing/ (Estimator, FeatureExtractor, LoopClosureDetector)
• optimization/ (ICP, PoseGraphOptimizer, AdaptiveMEstimator)
• util/ (Config loader, MathUtils, PointCloudUtils, Types)
• viewer/ (PangolinViewer)
• “thirdparty/”: external libraries (Ceres Solver, Pangolin, LidarIris, Sophus, nanoflann, spdlog, etc.).
• Data Sources (KITTI sequence, MID360 PLY files)
• Config Loader (reads YAML → parameter objects)
• Dataset Player (streams raw point clouds / timestamps)
• Database Module (stores keyframes & metadata)
• Processing Pipeline
• FeatureExtractor (computes descriptors)
• Odometry Estimator (frame-to-frame ICP)
• LoopClosure Detector (runs asynchronously on keyframe queue)
• Optimization Module
• ICP Optimizer (refines loop candidates)
• PoseGraphOptimizer (Ceres‐based PKO/PGO)
• Viewer (Pangolin for 3D rendering)
• Logging (spdlog)
• Config → all modules
• Player → raw cloud → FeatureExtractor → OdometryEstimator → Database
• Database keyframes → LoopClosureDetector → ICPOptimizer → PoseGraphOptimizer
• Odometry constraints + loop constraints → PoseGraphOptimizer → updated poses
• Main thread consumes updated poses → Viewer
c. Architectural Patterns & Principles
• Modular, layered pipeline: data ingestion → processing → optimization → visualization
• Asynchronous background thread for loop closure & pose graph (non-blocking odometry)
• Separation of concerns: database vs. processing vs. optimization vs. UI
• Dependency injection of config & utilities
d. Technologies & Libraries
• Ceres Solver for nonlinear PKO/PGO
• Pangolin for OpenGL visualization
• LidarIris for loop closure descriptors
• Sophus & nanoflann for geometry & nearest neighbor search
• spdlog for logging
• YAML for configuration