provencher / MRTK-Quest

MRTK-Quest: Mixed Reality Toolkit (MRTK) extension bridge for Oculus Quest + Rift / S
Other
389 stars 67 forks source link

Hand detection errors in different places #91

Open Alexees opened 3 years ago

Alexees commented 3 years ago

When detecting and losing hands, I receive about 3 different errors completely at random. In the MRKT-Quest_BasicSetup scene I randomly get spammed with this because the Controller is null:

NullReferenceException: Object reference not set to an instance of an object
Microsoft.MixedReality.Toolkit.Input.LinePointer.get_IsInteractionEnabled () (at Assets/MixedRealityToolkit/MRTK/SDK/Features/UX/Scripts/Pointers/LinePointer.cs:56)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.Process () (at Assets/MixedRealityToolkit/MRTK/Services/InputSystem/MixedRealityInputModule.cs:123)
UnityEngine.EventSystems.EventSystem.Update () (at C:/Program Files/Unity/Hub/Editor/2019.3.14f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

Since I am not using the shipped but the official teleport pointer. That one is also causing two errors every now and then:

TeleportCursor.cs: 96
Debug.LogError($"{pointer.GetType().Name} has not been registered! " + pointer.PointerId);

This is because the FocusProvider does not have the requested pointer. And finally:

TeleportPointer.cs: 355
                    if (eventData.SourceId == InputSourceParent.SourceId &&
                    eventData.Handedness == Handedness &&
                    eventData.MixedRealityInputAction == teleportAction)

This is because InputSourceParent is null by the time this is called.

In sum of the errors lead to the pointers still being active for at a least one frame (the first error can get spammed quite a lot) after a source has been lost. It was beyond me to find out why this is. Most of the missing references happen for objects that shouldn't be in the dictionary they were iterated over because of them being altered in OnSourceDetected and OnSourceLost.

provencher commented 3 years ago

I forwarded your feedback to the MRTK folks. As for the teleport issues, the official pointer is not designed for hand tracking and the way to get it working is a hack, so I genuinely advise against using it over the custom one.

Beyond that, the custom teleport pointer has a number of usability improvements, including audio, stabilization and improved responsiveness, in addition to having a cursor that animates and doesn't error.

Alexees commented 3 years ago

Is it possible to extend the reach of the custom one. That was the main reason I was not using it

provencher commented 3 years ago

Yeah I think all you'd have to do is adjust the ballistic angle. There's a limit to how far it can go from the parabolic math, but I'm sure you could extend the range.

Alexees commented 3 years ago

@provencher I could not find the issue for this on one MRKT git issue page, but I created another, maybe related or the same. https://github.com/microsoft/MixedRealityToolkit-Unity/issues/8429