Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Vive Pro Controller isTracked is false while visible / Unity 2019.1.0f2 [Closed/Solved]

Discussion in 'AR/VR (XR) Discussion' started by LiquidBergmann, May 28, 2019.

  1. LiquidBergmann

    LiquidBergmann

    Joined:
    Feb 5, 2019
    Posts:
    6
    Hi everyone,

    I'm currently developing a VR application and use
    Code (CSharp):
    1. UnityEngine.XR.InputDevices.GetDevicesAtXRNode(UnityEngine.XR.XRNode.LeftHand, xrInputDevices);
    to get my left and right hand. The application is very simplified for input and uses only one controllers touchpad at a time. Since this will be installed at a museum the thought was, to use only one controller while the other can charge in a place outside of the tracking space.

    During testing I get the following behavior:
    Controller A is on and connected and inside the visible tracking area (and is shown in Steam VR [v 1.3.23] screens and during loading times). Controller B is plugged in to charge outside the visible tracking space.

    On Start() I get a reference to my controllers leftHand/rightHand with the code snippet posted above^^.
    Now during playtime I can't get any input from Controller A. It is found as XR.InputDevice but I can't get any input polled from it. If I call
    Code (CSharp):
    1. xrLeftHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.isTracked, out leftIsTracked);
    I get a false.
    Code (CSharp):
    1. xrLeftHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.primary2DAxis, out leftHandInput);
    gives me a 0.0f, 0.0f.
    After restarting SteamVR I can get one playthrough working but on the next try I get the same situation again.

    If I disconnect and set the second controller to off I have no such problems.

    Is there any possibility to force "getting" input from the controller?

    Thanks in advance and cheers,
    Leo
     
  2. LiquidBergmann

    LiquidBergmann

    Joined:
    Feb 5, 2019
    Posts:
    6
    And I should add, this behaviour doesn't seem to happen if the Controller B (charging) is visible to the tracking system.
     
  3. thelghome

    thelghome

    Joined:
    Jul 23, 2016
    Posts:
    737
    Please check if it's valid with below scripts.
    Code (CSharp):
    1. var inputDevices = new List<InputDevice>();
    2. InputDevices.GetDevices(inputDevices);
    3.  
    4. foreach(InputDevice _device in inputDevices)
    5. {
    6.     Debug.Log(_device.isValid);
    7. }
    and check if your "TryGetFeatureValue" works or not with beow scripts.
    Code (CSharp):
    1. bool _success = xrLeftHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.isTracked, out leftIsTracked);
    2.  
    3. Debug.Log(_success);
     
  4. LiquidBergmann

    LiquidBergmann

    Joined:
    Feb 5, 2019
    Posts:
    6
    Hi @thlghome,

    Thanks for your reply. I've tried this.
    I seem to have circumvented this behaviour by not loading the controllers via a USB port on the computer but rather using a wall plug for it. Strange nevertheless but it fixed this.

    I'll close this thread.

    Cheers,
    Leo