Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller Jitter #116

Open
minusreality opened this issue Jun 20, 2024 · 3 comments
Open

Controller Jitter #116

minusreality opened this issue Jun 20, 2024 · 3 comments

Comments

@minusreality
Copy link

minusreality commented Jun 20, 2024

If I hold my hand out in SteamVR home, my hand tracking based controllers jitter noticeably. Is there any way of smoothing out the tracking? This occurs even without any kind of additional controller in hand.

VisionOS 2.0 Developer Beta 1
Latest ALVR Testflight 20.8.2 (2)
ALVR Server 20.8.1
Windows 11 4080 PC

@minusreality
Copy link
Author

handjitter.mov

@minusreality
Copy link
Author

session.json

@jamuus
Copy link

jamuus commented Aug 10, 2024

This seems related to asking handTracking.handAnchors for a prediction too far into the future, in my testing anchorTimestamp ends up around +60ms from the current timestamp. Limiting this to 20-30ms significantly reduces jitter.

Try this:

--- a/ALVRClient/Renderer.swift
+++ b/ALVRClient/Renderer.swift
@@ -757,11 +757,13 @@ class Renderer {
             
             let targetTimestamp = vsyncTime + (Double(min(alvr_get_head_prediction_offset_ns(), WorldTracker.maxPrediction)) / Double(NSEC_PER_SEC))
             let reportedTargetTimestamp = vsyncTime
-            var anchorTimestamp = vsyncTime + (Double(min(alvr_get_head_prediction_offset_ns(), WorldTracker.maxPrediction)) / Double(NSEC_PER_SEC))//LayerRenderer.Clock.Instant.epoch.duration(to: drawable.frameTiming.trackableAnchorTime).timeInterval
+            var anchorTimestamp = vsyncTime + Double(alvr_get_head_prediction_offset_ns())/Double(NSEC_PER_SEC) //LayerRenderer.Clock.Instant.epoch.duration(to: drawable.frameTiming.trackableAnchorTime).timeInterval
             if #available(visionOS 2.0, *) {
                 //anchorTimestamp = LayerRenderer.Clock.Instant.epoch.duration(to: drawable.frameTiming.trackableAnchorTime).timeInterval
             }
-            
+            let maxPred = CACurrentMediaTime()+Double(WorldTracker.maxPrediction)/Double(NSEC_PER_SEC);
+            anchorTimestamp = min(anchorTimestamp, maxPred);
+
             WorldTracker.shared.sendTracking(viewTransforms: viewTransforms, viewFovs: viewFovs, targetTimestamp: targetTimestamp, reportedTargetTimestamp: reportedTargetTimestamp, anchorTimestamp: anchorTimestamp, delay: 0.0)
         }
         

and fiddle with WorldTracker.maxPrediction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants