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

Multiple devices with the same SupportedControllerType break SynchronizeInputActions #8429

Closed Alexees closed 9 months ago

Alexees commented 4 years ago

Describe the bug

The MixedRealityControllerMappingProfileInspector throws exceptions whenever a pair of controller mappings does not match. Most SupportedControllerType's exist only once for a certain controller but once there are multiple with different mapping counts, merging actions break.

This happens because every controller encountered in MixedRealityControllerMappings gets added to the controllerRenderList. Every new controller is compared to every controller in the controllerRenderList and if SupportedControllerType and Handedness match it tries to write the action mappings and continue. Since they are checked in order, the first ArticulatedHand found is always the one additional controllers try to get actions from.

With Oculus Quest in the bag there are now 4 ArticulatedHands (Simulated Hand, Leap Motion, WMR and Quest). This system expects them all to have the same capabilities, which in case of the Quest are different.

To reproduce

Steps to reproduce the behavior:

  1. Copy DefaultInteractions from ArticulatedHandDefinition into one of the hands that are first in the DefaultMixedRealityControllerMappingProfile list and use as return for DefaultInteractions
  2. Update controller mappings (might be sufficient, if not 3.)
  3. Select the DefaultMixedRealityControllerMappingProfile in the project and unfold the mappings

Observe the errors in the log

Expected behavior

Each SupportedControllerType should probably have their own mapping. They're class based, not type based anyways

Your setup (please complete the following information)

Target platform (please complete the following information)

keveleigh commented 4 years ago

MRTK Version some older dev branch version

I think this has been fixed. OculusHand now uses the ArticulatedHandDefinition mappings exactly: https://github.com/microsoft/MixedRealityToolkit-Unity/blob/088e52889f24ae1c5e6d23e6a524d4468c871bc0/Assets/MRTK/Providers/Oculus/XRSDK/MRTK-Quest/Scripts/Input/Controllers/OculusHand.cs#L92

Alexees commented 4 years ago

@keveleigh I think that's partly true. The secondary hand has a finger pinch Start menu. It's getting polled differently than all the other Input (OVRInput instead of UnityEngine.Input), which means for that it's fine to not have it in the handdefinitions, BUT for the assignment of an InputAction you'd need one to show up for the hand in the inspector I would say

david-c-kline commented 3 years ago

The fully realized controller extensibility feature will most likely be realized in MRTK v3.

We will continue to look into opportunities to improve this in v2.x

stale[bot] commented 2 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

IssueSyncBot commented 9 months ago

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!