How davidmoranuclm/ekf_c works
Project Type and Purpose
• This is a C-based mathematical library providing an implementation of an Extended Kalman Filter (EKF) and supporting quaternion mathematics.
• It includes a small test suite (using Unity), utility scripts for plotting results, and integrates with GNU Scientific Library (GSL) for core math routines.
Key Components (to represent
a. Core EKF Module
• src/EKF.c and include/EKF.h – the filter logic
• /EKF_const.h – configuration and constant definitions
b. Math Utilities
• src/math_utils.c + include/math_utils.h – linear algebra helpers
• src/jacobian.c + include/jacobian.h – Jacobian matrix computations
c. Quaternion Support
• src/gsl_quaternion_float.c + include/gsl_quaternion_float.h – quaternion operations
• src/rotations.c + include/rotations.h – 3D rotation helpers
d. External Dependencies
• GSL (cloned in top level, used for more advanced math routines)
• Unity (in Unity/ folder, C unit testing framework)
e. Test Suite
• tests/*.c & tests/CMakeLists.txt – test cases for EKF, primitives, quaternions, jacobians
• Unity runner & harness in Unity/src
f. Utilities
Relationships & Interactions
• Core EKF calls math_utils, jacobian, and quaternion modules to perform state prediction and update.
• Quaternion and rotation modules may rely on GSL’s low-level vector/matrix types.
• Test suite invokes EKF, math_utils, jacobian, quaternion modules via Unity harness.
• Build system (CMakeLists.txt files) orchestrates compilation of src, linking to GSL and Unity, and execution of tests.
• utils/plotResults.m consumes output data generated by tests or example runs.
Architectural Patterns & Principles
• Layered architecture:
1) External libraries (GSL, Unity)
2) Core algorithm (EKF)
3) Supporting libraries (math, jacobian, quaternion, rotations)
4) Testing & utilities
• Separation of interface (include/) from implementation (src/)
• Test-driven development via Unity