MRTK3 Hand Tracking issues

I have been porting our software from the HoloLens 2 and a few other devices to ML2. For some reason we have been unable to get hand tracking to work correctly. The hands come into the scene and do track the user's hands, but for some reason the hands are scrambled. I posted an image of this a few months ago when this first came up. I have been jumping around from porting tasks to various headsets so I am just now getting back to this in the last 2 weeks. Rebuilt the project from the ground up, got all other features working aside from hands and one other.

So one of the errors was tracked down into MagicLeapAuxilaryHandDevice.cs line 212 -

             if (HandSubsystem.TryGetPinchProgress(HandNode,
                                                      out bool isPinchReady,
                                                      out bool isPinching,
                                                      out float pinchAmount))

seemingly sometimes HandNode comes back null and the class stops so the raycast never gets run. Commenting out this if statement gets the app to the point that actually starts drawing the raycast correctly, and colliding with the UI. But cannot interact with it, obviously since this if statement handles the pinching to trigger the interaction.

We do have a build of the MRDevTemplate that works perfectly. I have gone through every single setting in the Player settings, MRTK3 settings etc. to make sure they are the same. I can't find anything in our code that would be calling the Unity Input and MRTK3 input system differently.

Any help would be appreciated.

2022.3.13f1:
ML2 OS - 1.4.1:
MLSDK 1.4.0:
Windows 11: (Windows/MacOS)

**Error messages from logs
AndroidPlayer "Ml_Magic Leap 2@ADB:GB62XT10014E:0" ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00000] in <00000000000000000000000000000000>:0 at MixedReality.Toolkit.Input.XRSDKHandsSubsystem+XRSDKHandContainer.TryGetJoint (MixedReality.Toolkit.TrackedHandJoint joint, MixedReality.Toolkit.HandJointPose& pose) [0x00000] in <00000000000000000000000000000000>:0 at MixedReality.Toolkit.Input.MRTKHandsAggregatorSubsystem+AggregateHandContainer.TryGetJoint (MixedReality.Toolkit.TrackedHandJoint joint, MixedReality.Toolkit.HandJointPose& pose) [0x00000] in <00000000000000000000000000000000>:0 at MixedReality.Toolkit.Input.MRTKHandsAggregatorSubsystem+MRTKAggregator.TryGetPinchProgress (UnityEngine.XR.XRNode handNode, System.Boolean& isReadyToPinch, System.Boolean& isPinching, System.Single& pinchAmount) [0x00000] in <00000000000000000000000000000000>:0 at MagicLeap.MRTK.Input.MagicLeapAuxiliaryHandDevice.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe (UnityEngine.InputSystem.Utilities.CallbackArray1[System.Action]& callbacks, System.String callbackName, System.Object context) [0x00000] in <00000000000000000000000000000000>:0

** (syntax-highlighting is supported via Markdown):

To add further detail..

We noticed in the stacktrace that for some reason it is not using MagicLeapXRSDKSubsystem, but XRSDKSubsystem. I know we have MagicLeap selected in the settings.

Here are another set of Error message that sometimes appear as well.. though they are not consistent.

#1 - not sure why there is no callstack.
ArgumentOutOfRangeException while executing 'onBeforeUpdate' callbacks

#2 -

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.XRSDKHandsSubsystem+XRSDKHandContainer.TryGetJoint (MixedReality.Toolkit.TrackedHandJoint joint, MixedReality.Toolkit.HandJointPose& pose) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.MRTKHandsAggregatorSubsystem+AggregateHandContainer.TryGetJoint (MixedReality.Toolkit.TrackedHandJoint joint, MixedReality.Toolkit.HandJointPose& pose) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.MRTKHandsAggregatorSubsystem+MRTKAggregator.TryGetPinchingPoint (UnityEngine.XR.XRNode handNode, MixedReality.Toolkit.HandJointPose& jointPose) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.PinchPoseSource.TryGetPose (UnityEngine.Pose& pose) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.GazePinchInteractor.ComputeAttachTransform (UnityEngine.XR.Interaction.Toolkit.IXRSelectInteractable interactable) [0x00000] in <00000000000000000000000000000000>:0
at MixedReality.Toolkit.Input.GazePinchInteractor.ProcessInteractor (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.ProcessInteractors (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.Update () [0x00000] in <00000000000000000000000000000000>:0

@jason.odom Do you mind verifying that you are using the latest version of the MLSDK and the MRTK 3 for Magic Leap package?

Do you mind checking the Unity Package Manger instead to make sure the correct packages imported.

@jason.odom Are you only seeing the scrambled hands in Editor when running with Application Simulator? Or do you also see it on device?

The Application Simulator might have a bug with the pose of the hand joints, leading to the scrambled hand mesh.

1 Like

Sorry been out for surgery. It was only happening on device, that I can clearly say. There is another topic I have active that I have not been able to get the App Simulator working in quite some time.

All of that said, I did get the unscrambled hands working. At the moment I can not remember what the solution was. But I will remember and post the solution here.