SlimeVR / SlimeVR-Tracker-ESP

SlimeVR tracker firmware for ESP32/ESP8266 and different IMUs
Apache License 2.0
798 stars 274 forks source link

Merge code for applying `sensorOffset` and setting data ready flag #314

Closed nekomona closed 3 months ago

nekomona commented 4 months ago

Previous codes have ambiguity in when to computing delta angle for update check:

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.