Skip to content

Commit c316c50

Browse files
Fix tracker drift logging (#1588)
1 parent 81716be commit c316c50

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

server/core/src/main/java/dev/slimevr/tracking/processor/HumanPoseManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ class HumanPoseManager(val server: VRServer?) {
534534

535535
// Get the difference between last reset and now
536536
val difference = tracker
537-
.getRotation() * tracker.resetsHandler.lastResetQuaternion!!.inv()
537+
.getRotationNoResetSmooth() * tracker.resetsHandler.lastResetQuaternion!!.inv()
538538
// Get the pure yaw
539539
var trackerDriftAngle = abs(
540540
(

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,11 @@ class Tracker @JvmOverloads constructor(
412412
}
413413

414414
/**
415-
* Get the rotation of the tracker after the resetsHandler's corrections and filtering if applicable
415+
* Get the rotation of the tracker after the resetsHandler's corrections, filtering,
416+
* and reset smoothing if applicable
416417
*/
417418
fun getRotation(): Quaternion {
418-
var rot = if (trackRotDirection) {
419-
filteringHandler.getFilteredRotation()
420-
} else {
421-
// Get non-filtered rotation
422-
getAdjustedRotation()
423-
}
419+
var rot = getRotationNoResetSmooth()
424420

425421
if (yawResetSmoothing.remainingTime > 0f) {
426422
rot = yawResetSmoothing.curRotation * rot
@@ -429,6 +425,17 @@ class Tracker @JvmOverloads constructor(
429425
return rot
430426
}
431427

428+
/**
429+
* Get the rotation of the tracker after the resetsHandler's corrections and
430+
* filtering if applicable
431+
*/
432+
fun getRotationNoResetSmooth(): Quaternion = if (trackRotDirection) {
433+
filteringHandler.getFilteredRotation()
434+
} else {
435+
// Get non-filtered rotation
436+
getAdjustedRotation()
437+
}
438+
432439
/**
433440
* Gets the world-adjusted acceleration
434441
*/

0 commit comments

Comments
 (0)