New approach records original orientation quaternion and apply it to raw sensor values.
This works better than initialising sensor fusion algorithm with original quaternion, since depending on board orientation gravity vector may point at (+-1,0,0).
And that means quaternion pitch angle is near limit of 90deg. Upon crossing the limit, composition of Euler angles change and head tracker outputs jump.
Also, switched to mathgl vector library, instead of having own vector math functions in this repo.
Fixes #16
New approach records original orientation quaternion and apply it to raw sensor values.
This works better than initialising sensor fusion algorithm with original quaternion, since depending on board orientation gravity vector may point at (+-1,0,0). And that means quaternion pitch angle is near limit of 90deg. Upon crossing the limit, composition of Euler angles change and head tracker outputs jump.
Also, switched to mathgl vector library, instead of having own vector math functions in this repo.