Error State Kalman Filter
The error-state Kalman filter (ESKF) is one of the tools we may use for combining IMU with magnetometer data to obtain a robust attitude estimation. It has many benefits such as avoiding issues related to over-parameterization and the consequent risk of the singularity of the involved covariance matrices. The formulation of the ESKF algorithm used for attitude estimation is as follows:
Below are results of the ESKF for roll, pitch, and yaw angles. The red line represents the estimation values, and the green is the ground truth.