This PR set the applying of sensorOffset to be a common behavior before computing delta angle and setting the ready flag, removing the duplicated code distributed in each sensor's class.
With this PR, the update to fusedQuaternion and acceleration are also limited to setFusedRotation and setAcceleration methods, which may simplify future modifications for multi-threading.
Previous codes have ambiguity in when to computing delta angle for update check:
sensorOffset
(e.g. BMI160) https://github.com/SlimeVR/SlimeVR-Tracker-ESP/blob/b744c536764559c71b3d062552d159511fe8b69a/src/sensors/bmi160sensor.cpp#L364-L370This PR set the applying of
sensorOffset
to be a common behavior before computing delta angle and setting the ready flag, removing the duplicated code distributed in each sensor's class.With this PR, the update to
fusedQuaternion
andacceleration
are also limited tosetFusedRotation
andsetAcceleration
methods, which may simplify future modifications for multi-threading.