|
Algorithm 1. GDA algorithm |
|
Input: acc → measured acceleration, ω → measured angular velocity, mag → measured magnetometer, → earth’s gravity, → magnetic field vectors |
|
Output: → updated quaternions |
| 1. |
|
| 2. |
If ( | |||| - | < mag_ stability_thereshold ) then |
| 3. |
stability = 1 |
| 4. |
else then |
| 5. |
stability = 0 |
| 6. |
end if |
| 7. |
F() = - acc |
| 8. |
If (stability) then |
| 9. |
F() = −
|
| 10. |
=
|
| 11. |
else then |
| 12. |
) |
| 13. |
end if |
| 14. |
|
| 15. |
|
| 16. |
=
|
| 17. |
Return
|