OpenXR loss of tracking behavior

With OpenXR in 4.27, when motion controllers lose tracking, they snap to the tracking space origin, and then snap back to the tracked position once they regain it. There doesn’t seem to be any point to this behavior, and it can cause a lot of unintended consequences if things like meshes with collision or physics enabled are attached to the controllers. I’d consider this behavior a bug.

The behavior seems to be caused by FOpenXRHMD::GetCurrentPose() returning an identity transform when the tracking is invalid, combined with FOpenXRInputPlugin::FOpenXRInput::GetControllerOrientationAndPosition() passing a reference to the output position directly to the former function and not checking for the return value.

I submitted a bug report of this to the issue tracker a few weeks ago, but I didn’t receive any confirmation, so I’m not sure if it went through. I’m posting about it here too just in case.

2 Likes

Yes! this is not desired behavior…
I would rather they pause at last known location rather than snap to origin. This keeps happening when I’m actively using them due to controller/controller occlusion and then POP one of my hands is on the floor and the buttons are triggering from that location causing all sorts of wacky movement. I’m glad I’m not the only person having this happen… maybe it will be addressed.

Has anyone built in safeguards as a workaround? I was debating perhaps double checking my controller location every frame and if my controllers jump to origin disabling input … idk, I haven’t fully thought it through but was thinking I might need to do something since it’s a hassle when it happens and it happens enough to be a hassle.

1 Like

I had the same issue in 4.26 with the SteamVR plugin as well. I tried to get around it by using some utility function to detect if the controllers were tracking and disabling physics + teleporting them when the state changed. I couldn’t get it working reliably, so I ended up modifying the plugin instead (along with a modification to make it not launch SteamVR on startup).

Any update on your bug report? @Rectus_SA

Unfortunately not. I haven’t heard anything, and there is nothing in the issue tracker.

Our solution to this is to do the following on tick, which seems to work:

But yes, having tracking perhaps just stop updating the controller transforms sounds more logical.

3 Likes

Hey all I provided a response in the VR Template thread. This was the last thing I was looking into before winter break and I wasn’t able to reproduce it. Could you provide me with the HMD/Controller(s)/ and Runtime you’re using? Also how you force the controllers to stop tracking would be helpful, thanks.

2 Likes

Update: I was able to reproduce this in 4.27, but not in 5.0. There are unfortunately no more hotfixes for 4.27 planned, but the issue is not apparent in 5.0.

1 Like

Thanks. Looks like this commit fixed it by caching the last valid pose:
https://github.com/EpicGames/UnrealEngine/commit/a3748e48bce79ce75ecc0d72ed72854dadb9cac9#

2 Likes

@VictorLerp Good to know! I haven’t switched to 5 yet, and who knowns when oculus will release a v5 build, but I’m glad to know this issue is resolved when I do end up migrating.

@Rectus_SA look at that! we got it resolved :wink: a fix pushed 8 days after your og post and confirmation from internal within a few months.

1 Like