Search Unity

Unity Native XR Input Hand Tracking for Quest

Discussion in 'AR/VR (XR) Discussion' started by ROBYER1, Feb 20, 2020.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    I'm aware there is some functionality in XR Input for getting hand and finger tracking information in Unity, are there any examples or tutorials on this to make it more user-friendly? With Oculus Integration having an example of this but with its own solution, it would make sense for future compatibility with other solutions to use a native Unity solution through the XR Input offerings such as InputDeviceCharacteristics.HandTracking

    https://docs.unity3d.com/2020.1/Documentation/ScriptReference/XR.Hand.html

    If anything like this is working also, does it work with the latest Oculus Quest Remote Rendering which was added in the latest v13 firmware to allow developers to iterate easily on hand-tracked projects?
    https://forums.oculusvr.com/community/discussion/86022/quest-go-build-13-0-release-notes/p1

    "Remote rendering support for Unity has been added so developers can more easily build and test Hand Tracking apps through their PC"

    This all sounds like it should work together but I can't quite figure out how to set it all up. If anyone has any examples or guidance, please let me know!
     
    ariza-oscar and DrummerB like this.
  2. GridWanderer

    GridWanderer

    Joined:
    Dec 14, 2014
    Posts:
    12
    Concerned as well. Not having any luck with the below script:

    Code (CSharp):
    1.  
    2. Hand right_hand = new Hand();
    3. Hand left_hand = new Hand();
    4. Bone right_hand_bone = new Bone();
    5. Bone left_hand_bone = new Bone();
    6.  
    7. void FixedUpdate()
    8. {
    9.   InputDevices.GetDevicesWithCharacteristics(InputDeviceCharacteristics.HandTracking, _input_devices);
    10.   foreach (InputDevice input_device in _input_devices)
    11.   {
    12.     // RIGHT HAND:
    13.     if ((input_device.characteristics & InputDeviceCharacteristics.Right) != 0)  // Bit-wise AND
    14.     {
    15.       Debug.Log("HAND TRACKING: Right HandTracking device found !");
    16.       if (input_device.TryGetFeatureValue(CommonUsages.handData, out right_hand))
    17.       {
    18.       if (right_hand.TryGetRootBone(out right_hand_bone))
    19.         Debug.Log("HAND TRACKING: FixedUpdate(): Right hand root bone found !");
    20.       }
    21.     }
    22.     // LEFT HAND:
    23.     else if ((input_device.characteristics & InputDeviceCharacteristics.Left) != 0)  // Bit-wise AND
    24.     {
    25.       Debug.Log("HAND TRACKING: Left HandTracking device found !");
    26.       if (input_device.TryGetFeatureValue(CommonUsages.handData, out left_hand))
    27.       {
    28.         if (left_hand.TryGetRootBone(out left_hand_bone))
    29.           Debug.Log("HAND TRACKING: FixedUpdate(): Left hand root bone found !");
    30.       }
    31.   }
    32. }
    33.  


    Any chance hand tracking will be supported for Oculus Quest in the next update to the XR Input system?
    Hoping this is in the works.
     
    ROBYER1 and ariza-oscar like this.
  3. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    I am conducting a trial of my app - a VR-based stress & anxiety treatment for patients and it would be much simpler for logistical and hygiene reasons if I could use hand tracking on the Quest natively.

    Has anyone got this working, is there a reason why it isn't working?

    Watch for news here: https://forum.unity.com/threads/oculus-quest-hand-tracking-data.853579/
     
    GridWanderer likes this.
  4. Polff

    Polff

    Joined:
    May 18, 2017
    Posts:
    30
    Hey @GridWanderer did you set the handtracking permissions in your Android manifest before testing your script?
     
  5. GridWanderer

    GridWanderer

    Joined:
    Dec 14, 2014
    Posts:
    12
    Hi Polff,

    Unfortunately, I believe so. I included these two lines in the manifest:

    Code (CSharp):
    1. <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /><!-- Request the headset DoF mode -->
    2. <uses-feature android:name="oculus.software.handtracking" android:required="true" /><uses-permission android:name="oculus.permission.handtracking" /><!-- Request the headset handtracking mode -->
    While there is currently some very limited support for this feature (on Magic Leap I think), the Unity devs continue to be led by some strange decision-making. I'll reserve my judgement of Tony Parisi for now, but I will tell you that he does not believe in investing Unity too heavily in VR at the moment, being currently instead focused on non-gaming prospects for Unity: handheld AR branded experiences, product visualization, and ad revenue models. While handheld AR has been getting a lot of attention (including the successful work on ARFoundation), I don't think Tony will be able to see the relevance of OpenXR and headset-worn experiences until he talks with some of the developers at Unity (which will probably happen immediately after Apple's AR / VR headsets have fully debuted). As a consequence, the VR division at Unity is unfortunately only ¼ the size that that would be reasonable to expect, given it's importance to Unity's future. Anyway, the important thing is to not judge any of the developers too heavily on this, and here is a helpful update on this subject from the dev team, posted Friday: Link to Post
     
    Last edited: Nov 8, 2020