Merge code for applying sensorOffset
and setting data ready flag
#314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous codes have ambiguity in when to computing delta angle for update check:
sensorOffset
(e.g. BMI160)SlimeVR-Tracker-ESP/src/sensors/bmi160sensor.cpp
Lines 364 to 370 in b744c53
SlimeVR-Tracker-ESP/src/sensors/icm42688sensor.cpp
Lines 175 to 179 in b744c53
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
andacceleration
are also limited tosetFusedRotation
andsetAcceleration
methods, which may simplify future modifications for multi-threading.