ysoldak / HeadTracker

Zero configuration, auto-calibrating wireless DIY Head Tracker, for Nano 33 BLE and XIAO BLE Sense boards
The Unlicense
58 stars 8 forks source link

Fix board orientation issue #17

Closed ysoldak closed 1 year ago

ysoldak commented 1 year ago

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.