How hviktortsoi/pv-lio works
Main Components
a. Sensor Input Modules:
• LiDAR Data Input – This includes support for multiple LiDAR sensors (Livox, Velodyne, Robosense, Hesai, etc.) as seen by the different launch files and config files named mapping_avia.launch, mapping_velodyne.launch, mapping_robosense.launch.
• IMU Data Input – The system requires an IMU (internal or external) and expects synchronization with the LiDAR.
b. Data Preprocessing and Conversion:
• Preprocessing Module – Represented in files like src/preprocess.cpp and converters (e.g., pandar_to_velodyne.cpp, rs_to_velodyne.cpp) which reformat sensor data to a unified internal representation.
c. Fusion and Odometry Estimation:
• LiDAR-Inertial Fusion Core – The heart of the system using iterative Kalman filtering (IKFoM) for state estimation. This module likely relies on include libraries such as IKFoM_toolkit and components from VoxelMap (with covariance estimation) that are integrated into the state estimation.
d. Mapping Module:
• Voxel Mapping Engine – Utilizes an adapted version of VoxelMap to manage local maps, including modules to compute and propagate covariances for each LiDAR point-feature correspondence and perform parallel-optimized map updates.
e. Configuration/Parameter Management:
• Configurations - The config directory contains YAML files (like avia_indoor.yaml, hesai.yaml, etc.) which set sensor topics, extrinsics, and operational parameters.
f. Logging and Visualization:
• Log Files and Visualization Tools – There is a Log directory with scripts (e.g., plot.py) and RViz configuration files to allow runtime or offline analysis and visualization of both the voxel map and uncertainty estimates.
g. ROS Launch and Build:
• Launch Files – Multiple launch files provide a streamlined way to initialize sensor drivers and nodes for different LiDAR sensor configurations.
• Build System – The CMakeLists.txt shows the project is built using CMake and integrated into a ROS workspace via package.xml.
Relationships and Interactions
• Sensor Data Flow: LiDAR and IMU sensors send raw data to the respective drivers. Their outputs flow through the preprocessing modules where formats are unified and any necessary timing synchronization (or time adjustments) is handled.
• Fusion: The preprocessed data then enters the fusion module that uses IKFoM to combine the LiDAR point cloud features with the IMU inertial measurements. Here, extrinsic calibrations (defined in the config YAML files) are applied.
• Mapping: The fusion output, which contains the state (pose) estimates, is then used by the Voxel Mapping engine to maintain and update the local map. Covariance propagation is applied here to account for measurement uncertainty.
• Configuration: All these components read their parameters (sensor topics, extrinsics, time-sync options, etc.) from the configuration files.
• Data Logging & Visualization: Throughout these processes, logs and visualization tools are engaged to analyze performance and debug issues, with results viewable in RViz, as set by the provided RViz configuration files.
Architectural Patterns & Design Principles
• Modular Design: The system separates sensor data acquisition, preprocessing, fusion/estimation, and mapping into distinct modules.
• ROS-based Componentization: Different ROS nodes (as specified in the launch files) handle sensor interfacing and computation, encapsulating functionality.
• Configuration Driven: YAML config files drive sensor parameters and extrinsics, making the system highly configurable for different sensor setups.
• Use of External Libraries: It integrates third-party libraries such as IKFoM for the Kalman filtering and VoxelMap for mapping, promoting code reuse and leveraging enhanced functionality.
Relevant Technologies and Frameworks
• Operating Environment: Ubuntu (>=16.04) with ROS (>= Melodic)
• Libraries and Dependencies: PCL, Eigen, IKFoM, VoxelMap, and livox_ros_driver (for Livox LiDAR).
• Build System: CMake and ROS catkin_make build process.
Elements
• Use clearly labeled components (e.g., "LiDAR Driver", "IMU Driver", "Preprocessing Module", "IKFoM Fusion Module", "Voxel Mapping Engine", "ROS Launch Manager").
• A note on the build/integration process (CMake, package.xml) as a supporting subsystem, though focus primarily on runtime architecture.