| Algorithm A1 |
|
for each measured sample from the sensors do
|
|
|
| Prediction |
| Predict gravity and acceleration (KFacc) |
|
|
| Process noise covariance matrix (KFacc) |
|
|
| Predict Earth’s magnetic field and disturbances (KFmag) |
|
|
| Process noise covariance matrix (KFmag) |
| Update: |
|
|
| Measurement update (KFacc) |
|
|
|
|
| KalmanUpdate (, , , , ) |
| Measurement update (KFmag) |
|
|
|
|
| KalmanUpdate (, , , , ) |
| Orientation computation (TRIAD algorithm)
|
| Normalize and to one |
|
|
|
|
|
|
| end for |