How zm0612/eskf-gps-imu-fusion works
The project is an algorithmic implementation of an Error-State Kalman Filter (ESKF) designed for fusing GPS and IMU data for navigation/trajectory estimation. In essence, it’s a signal processing application rather than a full-blown full-stack system. The focus is on sensor fusion, filtering, and data processing to improve trajectory estimation, with the ultimate goal of comparing results using IMU integration alone vs. using ESKF fusion.
Main Components
• ESKF Core: The central logic implemented in files like src/eskf.cpp and include/eskf.h.
• Data Handling & Tools: Modules related to reading, processing, and analyzing sensor data (e.g., include/gps_data.h, include/imu_data.h, src/gps_tool.cpp, src/imu_tool.cpp).
• Fusion Flow: The higher-level flow managing the integration process across sensors (e.g., src/eskf_flow.cpp, include/eskf_flow.h).
• External Libraries and 3rd Party Components: This includes GeographicLib located under the 3rd directory, and dependencies like Eigen, YAML, and Glog that are integrated via CMake.
• Configuration & I/O: The config folder (with config.yaml) defines parameters for the filter, and the data folder handles both raw sensor data (CSV files) and generated outputs.
• Testing: The test directory ensures the correctness of key components with unit tests for GPS, IMU, and tool functions.
Relationships and Data Flow
• Data Acquisition: The raw sensor data is organized in the data/raw_data folder and is fed into the ESKF algorithm via the fusion executable (app/gps_imu_fusion.cpp).
• Sensor Fusion Workflow: The ESKF core (error state calculations, correction, and propagation) is used by an orchestrating flow (eskf_flow) that dynamically fuses IMU and GPS inputs.
• External Libraries: GeographicLib is available in-house (copied under the 3rd folder) and is likely used for geospatial transformations which complement the sensor fusion.
• Input Parameters: The configuration parameters held in config/config.yaml dictate how the fusion process works. The executable takes configuration and data paths as arguments.
• Output & Visualization: After fusion, output trajectory files are produced in the data folder, and display_path.py uses these outputs to generate visualization of trajectories.
• Testing and Validation: Tests in the test folder are crucial for verifying integrity and correctness of the components.
Architectural Patterns and Design Principles
• Modular Design: The code is cleanly divided into modules, with distinct directories for application logic (app/ and src/), interfaces (include/), and testing (test/).
• Dependency Management via CMake: The CMake files (top-level CMakeLists, cmake directory scripts) ensure the correct integration of external libraries and internal modules.
• Separation of Concerns: Each module (data processing, filter implementation, visualization) has a dedicated directory or file, allowing for independent development and testing.
• Auxiliary dependencies: Connect the configuration file to the Fusion Engine module; show the external dependency modules (GeographicLib, Eigen, YAML, Glog) branching into the Fusion Engine.
• Testing components separately: Illustrate that unit tests monitor the individual modules within the sensor data processing and fusion modules.
• “build and deploy” references: Optionally annotate the build process via CMake as part of the setup and dependency resolution.