UnityPlugin icon indicating copy to clipboard operation
UnityPlugin copied to clipboard

[Feature Request] Support Desktop Mode for XRServiceProvider

Open camnewnham opened this issue 10 months ago • 3 comments

I've recently been using an Ultraleap for testing UI targeting HoloLens2 and Quest devices. So far, this has been working very well and it's been an excellent mechanism for improving UI iteration time and debugging.

The goal here is:

  • Use the screen-based "XR Device Simulator" sample provided by Unity (to avoid putting on and removing a headset during development)
  • Use an Ultraleap in Desktop mode to add detailed hand simulation (to avoid using keyboard/mouse to control complex hands)
  • Use the on-device hand tracking inbuilt in HoloLens/Quest at runtime.

The XRServiceProvider is needed (as opposed to the regular service provider...) because we need to position the ultraleap relative to the camera (via setting the device origin), except that rather than having it on the camera as would be typically for HMD XR, it's at a relative offset that approximates where the desk is relative to my seated position.

I've worked around this by extending the service provider to set the appropriate policy and some other useful configurations for this purpose.

I created a Pre and Post processor to disable and re-enable Ultraleap in the editor when building to run on device.

Two requests:

  1. Could desktop mode be supported in the LeapXRServiceProvider ? Or alternatively, could a third service provider be supported?
  2. Could there be an option to only enable the Leap XRHands Subsystem in editor mode?

camnewnham avatar Apr 23 '24 02:04 camnewnham

Using an XR Service Provider for non-XR use (though I understand the end use is XR) is an odd behaviour for us to implement

Is there an issue with using your extended provider for your specific use-case?

Also, have you considered using the ChangeTrackingMode function to change the tracking mode of the LeapXRServiceProvider at runtime?

To address your 2nd question. I also feel this may be a little specific to your use-case for us to implement it in the Plugin directly. It's quite rare to want to only use Ultraleap when in the editor, but not in builds. If you are using Ultraleap's OpenXR layer (which comes installed with the Tracking Service) you can actually just use Unity's XRHands Subsystem (follow the OpenXR tab here - also highlighted in the attached image)

image

MattGrayUL avatar Apr 23 '24 08:04 MattGrayUL

As a completely alternative solution. The LeapServiceProvider in Desktop mode will position the hands relative to the Transform of the Gameobject that the LeapServiceProvider component is attached to.

This means you would be able to position the LeapServiceProvider GameObject the same way that you do with your proxy here

However, as I have just checked, the XRHands Subsystem requires a LeapXRServiceProvider currently. This is something we could change to support using Desktop providers. Or in the meantime, tyou could too - by looking for just LeapServiceProvider rather than LeapXRServiceProvider here

MattGrayUL avatar Apr 23 '24 08:04 MattGrayUL

Thanks for getting back to me Matt.

Is there an issue with using your extended provider for your specific use-case?

Not technically. Only to a) clean up my project and b) contribute to improvements that might help others. But if (b) is not the case then no worries :) Honestly it is an absolute joy to develop UI this way without requiring a HMD!

Also, have you considered using the ChangeTrackingMode function to change the tracking mode of the LeapXRServiceProvider at runtime?

Thanks - that cleans things up a little.

you can actually just use Unity's XRHands Subsystem (follow the OpenXR tab here - also highlighted in the attached image)

I'd like to - but haven't managed to get it to work. Moved to a separate issue https://github.com/ultraleap/UnityPlugin/issues/1608

camnewnham avatar May 02 '24 05:05 camnewnham

I think we will leave this Issue here, and I will pick up on https://github.com/ultraleap/UnityPlugin/issues/1608 :)

MattGrayUL avatar May 13 '24 09:05 MattGrayUL