From e2e0a3d87df94eabf00392ca0cc52f9f933b18e5 Mon Sep 17 00:00:00 2001 From: Erimel Date: Tue, 17 Nov 2026 20:52:02 -0500 Subject: [PATCH] tune prediction --- server/core/src/main/java/dev/slimevr/config/settings.kt | 2 +- server/core/src/main/java/dev/slimevr/resets/module.kt | 3 ++- .../java/dev/slimevr/skeleton/inputprocessors/filtering.kt | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/server/core/src/main/java/dev/slimevr/config/settings.kt b/server/core/src/main/java/dev/slimevr/config/settings.kt index fbfb5f2ab..c21b6e422 100644 --- a/server/core/src/main/java/dev/slimevr/config/settings.kt +++ b/server/core/src/main/java/dev/slimevr/config/settings.kt @@ -117,7 +117,7 @@ data class SkeletonTogglesConfig( @Serializable data class SkeletonRatiosConfig( val smoothingStrength: Float = 0.15f, - val predictionStrength: Float = 0.25f, + val predictionStrength: Float = 0.30f, val spineCurvature: Float = 0.75f, val imputeSpineFromUpperToLower: Float = DEFAULT_SPINE_UPPER_LOWER, val interpolateUpperLegsTwistWithLowerLegs: Float = 0.80f, diff --git a/server/core/src/main/java/dev/slimevr/resets/module.kt b/server/core/src/main/java/dev/slimevr/resets/module.kt index 89b281ad9..69894ffa5 100644 --- a/server/core/src/main/java/dev/slimevr/resets/module.kt +++ b/server/core/src/main/java/dev/slimevr/resets/module.kt @@ -46,7 +46,8 @@ import kotlin.collections.listOf import kotlin.time.Duration.Companion.seconds import kotlin.time.TimeMark -private const val FEET_POSE_DEG_INWARDS = 18 +// Feet go slightly inwards on pose mounting +private const val FEET_POSE_DEG_INWARDS = 15 data class ResetsState( val canDoYawReset: Boolean, diff --git a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/filtering.kt b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/filtering.kt index 5c29cffa5..07fbc5823 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/filtering.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/filtering.kt @@ -35,8 +35,8 @@ private val UPSAMPLING_TIME_CARRYOVER_LIMIT = 900.milliseconds private const val SMOOTHING_MS_MAX = 50.0 // Prediction -private const val PREDICTION_MS_MAX = 32.0 -private const val PREVIOUS_PREDICTION_DECAY = 0.25f +private const val PREDICTION_MS_MAX = 30.0 +private const val PREVIOUS_PREDICTION_CARRYOVER = 0.2f // Used to minimize latency even more for arm tracking where it is more noticeable private val PART_MULTIPLIER = BodyPartMap( @@ -100,7 +100,7 @@ private fun computePredictedRotation( if (previousRotation == null) return targetRotation // Use some of the previous prediction - val previousPredictionDelta = previousPredictedRotation?.localAbout(previousRotation)?.pow(PREVIOUS_PREDICTION_DECAY) + val previousPredictionDelta = previousPredictedRotation?.localAbout(previousRotation)?.pow(PREVIOUS_PREDICTION_CARRYOVER) ?: Quaternion.IDENTITY val currentDelta = if (poseTimeDelta > Duration.ZERO) {