Skip to content

Commit 0172236

Browse files
committed
Remove last remnants of drift compensation
1 parent 5a2c2eb commit 0172236

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class Tracker @JvmOverloads constructor(
270270

271271
/**
272272
* Gets the adjusted tracker rotation after the resetsHandler's corrections
273-
* (reset, mounting and drift compensation).
273+
* (reset and mounting).
274274
* This is the rotation that is applied on the SlimeVR skeleton bones.
275275
* Warning: This performs several Quaternion multiplications, so calling
276276
* it too much should be avoided for performance reasons.
@@ -285,7 +285,7 @@ class Tracker @JvmOverloads constructor(
285285

286286
// Reset if needed and is not computed and internal
287287
return if (allowReset && !(isComputed && isInternal) && trackerDataType == TrackerDataType.ROTATION) {
288-
// Adjust to reset, mounting and drift compensation
288+
// Adjust to reset and mounting
289289
resetsHandler.getReferenceAdjustedRotationFrom(rot)
290290
} else {
291291
rot
@@ -305,7 +305,7 @@ class Tracker @JvmOverloads constructor(
305305

306306
// Reset if needed and is not computed and internal
307307
return if (allowReset && !(isComputed && isInternal) && trackerDataType == TrackerDataType.ROTATION) {
308-
// Adjust to reset, mounting and drift compensation
308+
// Adjust to reset and mounting
309309
resetsHandler.getReferenceAdjustedRotationFrom(rot)
310310
} else {
311311
rot
@@ -314,7 +314,7 @@ class Tracker @JvmOverloads constructor(
314314

315315
/**
316316
* Gets the identity-adjusted tracker rotation after the resetsHandler's corrections
317-
* (identity reset, drift and identity mounting).
317+
* (identity reset and identity mounting).
318318
* This is used for debugging/visualizing tracker data
319319
*/
320320
fun getIdentityAdjustedRotation(): Quaternion {

server/core/src/main/java/dev/slimevr/tracking/trackers/TrackerResetsHandler.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import io.github.axisangles.ktmath.Quaternion
1010
import io.github.axisangles.ktmath.Vector3
1111
import kotlin.math.*
1212

13-
/** Class taking care of full reset, yaw reset, mounting reset, and drift compensation logic. */
13+
/** Class taking care of full reset, yaw reset, and mounting reset logic. */
1414
class TrackerResetsHandler(val tracker: Tracker) {
1515

1616
private val HalfHorizontal = EulerAngles(
@@ -187,9 +187,8 @@ class TrackerResetsHandler(val tracker: Tracker) {
187187
Quaternion.IDENTITY
188188
}
189189

190-
// Old rot for drift compensation
191-
val oldRot = adjustToReference(tracker.getRawRotation())
192-
lastResetQuaternion = oldRot
190+
// Old rot for drift logging
191+
lastResetQuaternion = adjustToReference(tracker.getRawRotation())
193192

194193
// Adjust raw rotation to mountingOrientation
195194
val rotation = tracker.getRawRotation()
@@ -280,9 +279,8 @@ class TrackerResetsHandler(val tracker: Tracker) {
280279
return
281280
}
282281

283-
// Old rot for drift compensation
284-
val oldRot = adjustToReference(tracker.getRawRotation())
285-
lastResetQuaternion = oldRot
282+
// Old rot for drift logging
283+
lastResetQuaternion = adjustToReference(tracker.getRawRotation())
286284

287285
val yawFixOld = yawFix
288286
yawFix = fixYaw(tracker.getRawRotation(), reference)

0 commit comments

Comments
 (0)