# EKF-based AHRS algorithm

### Description

Implementation of the EKF-based AHRS algorithm based on measurements from three-component accelerometer with orthogonal axes, vector magnetometer and three-axis gyroscope. Estimates the current quaternion attitude.

### Usage

1 | ```
ahrs.EKF.QUATERNION(Filter, Sensors, Parameters)
``` |

### Arguments

`Filter` |
data structure for Extended Kalman Filter |

`Sensors` |
calibrated gyroscope, accelerometer and magnetometer measurements Sensors.w current calibrated gyroscope measurement [3x1], rad/sec Sensors.a current calibrated accelerometer measurement [3x1], g Sensors.m current calibrated magnetometer measurement [3x1], |m| = 1 |

`Parameters` |
AHRS Parameters Parameters.mn Magnetic Field Vector In Navigation Frame [3x1], |m|= 1 Parameters.an Acceleration vector In Navigation Frame [3x1], g Parameters.dt Sampling period, 1/Hz |

### Value

Q estimated attitude quaternion [1x4] Filter data structure for an Extended Kalman Filter dw estimated gyroscopes bias [1x3]

### Author(s)

Jose Gama

### References

Vlad Maximov, 2012 Scalar Calibration of Vector accelerometers and magnetometers, GyroLib documentation

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.