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
6k stars 2.12k forks source link

InputDataExample does not work with Motion Controllers and has issues with XBox Controllers #11401

Closed ARGs-code closed 9 months ago

ARGs-code commented 1 year ago

Describe the bug

No input is received from a Motion Controller in the InputDataExample Scene that is included with the MRTK Examples.

For XBox controllers, no joystick input is received in the InputDataExample, only button presses and trigger info is captured.

To reproduce

Steps to reproduce the behavior:

  1. Get Unity 20220.3.xx, create a project, install MRTK 2.8.3 and the Demos - Input from the MRTK Examples
  2. Bluetooth pair a Windows Mixed Reality Motion Controller to your computer (I just paired one, the right handed one)
  3. Confirm WMR controller shows as connected in your Bluetooth Settings
  4. Open InputDataExample Scene
  5. Observe there is no input at all recorded or shown from Mixed Reality Controller

Expected behavior

This example scene should be able to capture input from a Mixed Reality Controller, including the joystick & trigger.

Your setup (please complete the following information)

Target platform (please complete the following information)

Additional context

This has only been tested so far in the Unity Editor.

ARGs-code commented 1 year ago

I also observe that with this exact same setup, no Joystick information is provided in this scene when using an XBox controller, only button presses are received. There is no 2D joystick data for either the left or right joystick. Triggers & Buttons all respond as appropriately, but the joysticks never return any value.

keveleigh commented 1 year ago

Ah, interesting. I'll admit I'm not super familiar with this example scene and instead default to using the "runtime tool" at https://github.com/microsoft/MixedRealityToolkit-Unity/tree/main/Assets/MRTK/Tools/RuntimeTools/Tools/MixedRealityInteractionTool, though I'm not sure that's easily accessible via the UPM distribution.

Can you please confirm which XR plugin you're using? Windows XR Plugin, OpenXR Plugin, etc?

ARGs-code commented 1 year ago

Ah, interesting. I'll admit I'm not super familiar with this example scene and instead default to using the "runtime tool" at https://github.com/microsoft/MixedRealityToolkit-Unity/tree/main/Assets/MRTK/Tools/RuntimeTools/Tools/MixedRealityInteractionTool, though I'm not sure that's easily accessible via the UPM distribution.

Can you please confirm which XR plugin you're using? Windows XR Plugin, OpenXR Plugin, etc?

This is with the OpenXR plugin. I have also tried polling every single Input Axis available in the input manager manually and also am getting nothing.

ARGs-code commented 1 year ago

Something else of note, I do not know if this is important or not: I only have Mixed Reality Controllers. The client wants to use them with the Hololens 2, because they previously used them with their Hololens 1. We are aware there is no tracking or anything, but the devices should still work as bluetooth provided input and are able to be paired to the Hololens 2. We successfully built and deployed a solution in the past using WMR Controllers with the Hololens 1 (and the client much prefers them to XBox/Game Controllers because they are one handed and fewer buttons).

I do not have any other MR device, and am just pairing these controllers to my developer computer via bluetooth. Is the Mixed Reality Portal and a WMR device required for these controllers to function as expected?

keveleigh commented 1 year ago

I have also tried polling every single Input Axis available in the input manager manually and also am getting nothing.

That may be because your setting in Project Settings -> Project -> Player -> Other Settings -> Active Input Handling is only set to the new input system, so the old bindings won't work anymore. This could explain the Xbox controller not working, but the motion controllers over OpenXR don't rely on the old input system in this way (I don't believe, at least! It's possible the APIs we call are somehow still backed by the old input system, but I thought they were distinct).

image

The client wants to use them with the Hololens 2, because they previously used them with their Hololens 1. We are aware there is no tracking or anything, but the devices should still work as bluetooth provided input and are able to be paired to the Hololens 2.

I'll admit, I wasn't even aware this was possible! I thought the proper Bluetooth drivers were missing or something, but maybe they're able to reuse whatever the Xbox controller uses. I'm afraid I no longer have access to a HoloLens to test this out.

ARGs-code commented 1 year ago

Active Input Handling for this project is/was set to Both as you have shown. Fairly certain this setting is applied by default when setting up the MRTK via the walkthrough.

The XBox controller works, just not the joysticks.

https://i.gyazo.com/e704a414fb6a88d219743e3a28c6076a.png

IssueSyncBot commented 9 months ago

Hi @ARGs-code,

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visithttps://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!