microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6.01k stars 2.12k forks source link

RegisterPointer error, Value cannot be null #3802

Closed genereddick closed 5 years ago

genereddick commented 5 years ago

Overview

I started getting the error below after updating to the latest code this morning.

Expected Behavior

Not this error

Actual Behavior

Error: ArgumentNullException: Value cannot be null. Parameter name: key System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Collections.Generic.Dictionary2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at :0) Microsoft.MixedReality.Toolkit.Input.DefaultPointerMediator.RegisterPointers (Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer[] pointers) (at Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers/DefaultPointerMediator.cs:40) Microsoft.MixedReality.Toolkit.Input.FocusProvider.RegisterPointers (Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource inputSource) (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:578) Microsoft.MixedReality.Toolkit.Input.FocusProvider.OnSourceDetected (Microsoft.MixedReality.Toolkit.Input.SourceStateEventData eventData) (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:1081) Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem.RaiseSourceDetected (Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource source, Microsoft.MixedReality.Toolkit.Input.IMixedRealityController controller) (at Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputSystem.cs:610) Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityJoystickManager.RefreshDevices () (at Assets/MixedRealityToolkit/Providers/UnityInput/UnityJoystickManager.cs:128) Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityJoystickManager.Update () (at Assets/MixedRealityToolkit/Providers/UnityInput/UnityJoystickManager.cs:56) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.UpdateAllServices () (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:1000) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.Update () (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:777)

Steps to reproduce

(Links to sample github project preferred)

Unity Editor Version

2018.3.11f1

Mixed Reality Toolkit Release Version

mrtk_development, as of this morning

wiwei commented 5 years ago

Do you have any other repro steps (i.e. particular scene, simulate in editor, is this VR, are you using the hand simulation stuff)?

genereddick commented 5 years ago

To be sure it wasn't some issue with my existing project, I tested and it is happening on a brand new project:

I created a new empty project. Added the folders from mrtk_development (updated as of about 10 minutes ago). Applied settings, Added Toolkit and Playspace to default Sample Project Set MixedRealityDefaultConfigurationProfile (asked me for this, which is new) Changed platform to UWP Checked Windows Mixed Reality in XR Settings. Set Holographic | Simulate in Editor Run (attached xbox controller)

Two errors, the one in this error report and a second which is related to the missing visualization profile described in part here #3687/

genereddick commented 5 years ago

Same project and error(s) appears in Mixed Reality Portal with hand controllers

genereddick commented 5 years ago

Doesn't seem to happen all the time, though I'm not seeing any pattern to it. But also getting this error sometimes:

Failed to read input report: The I/O operation has been aborted because of either a thread exit or an application request.
wiwei commented 5 years ago

@Railboy

wiwei commented 5 years ago

Okay thanks, I see this as well, I'll get this patched up.

wiwei commented 5 years ago

FYI the xbox controller:

https://github.com/Microsoft/MixedRealityToolkit-Unity/pull/3790

genereddick commented 5 years ago

@wiwei Saw the Xbox controller fix, thanks for that, and it is included in this test build.

The second error here is actually related to #3685 where, even w the Xbox fix, the lack of a handedness setting (or something) is causing it to fail to find a visualization profile and so throws an error in BaseControllers.TryRenderControllerModel:

 Debug.LogError("No controller model available. Failed to add controller game object to scene");

The error is a little confusing as in this case controller model refers to a controller visualization model. Not sure the error actually impacts anything, so I've just been converting it to:

 Debug.Log("No controller model available. Failed to add controller game object to scene");
Yoyozilla commented 5 years ago

@wiwei any update on the second error? @genereddick did you find the issue?

genereddick commented 5 years ago

Haven't seen this issue in awhile, so can probably close.