Search Unity

XRDevice.SetTrackingSpaceType returns fail. What's problem?

Discussion in 'VR' started by VenisterUT, Dec 18, 2017.

  1. VenisterUT

    VenisterUT

    Joined:
    Jan 26, 2017
    Posts:
    16
    XRDevice.SetTrackingSpaceType returns fail. :(

    And the log message follow,
    Anyone knows the reason?

    I tried Unity 2017.2.0p2-MRTP5 and Unity 2017.3.0f2 with Samsung Odyssey HMD and motion controllers, and the both versions are usually making same errors.
     
    astracat111 and soojcho like this.
  2. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
    Have you run the setup in Mixed Reality Portal? As long as the device can actually track at start-up, that message you pasted in shouldn't appear. And as the app is running, so long as the device has tracking at the time, SetTrackingSpaceType should succeed when getting set to TrackingSpaceType.RoomScale (SetTrackingSpaceType should always succeed when getting set to TrackingSpaceType.Stationary).
     
  3. soojcho

    soojcho

    Joined:
    Dec 11, 2017
    Posts:
    6
    i'm having the same issue per this thread https://forum.unity.com/threads/playing-unity-scene-in-vr-headset-via-wmr-portal.509206/

    i'm using lenovo explorer vr headsets and controllers and went through set up in mrp again but still didn't work. wondering if i need to download a specific toolkit in unity.
     
  4. thedavidslight

    thedavidslight

    Joined:
    Oct 29, 2016
    Posts:
    1
    Just FYI, I get this on play in the Unity Editor on my coding box which is not MR capable so obviously I have not (cannot) run MR setup.
     
  5. VenisterUT

    VenisterUT

    Joined:
    Jan 26, 2017
    Posts:
    16
    After I upgraded Unity to 2017.3, many problems got solved.
     
  6. holorider

    holorider

    Joined:
    Oct 24, 2018
    Posts:
    3
    XRDevice.SetTrackingSpaceType(TrackingSpaceType.Stationary);
    doesn't work with my HoloLens. I really need this!
    The return value is false.

    It should work according to
    https://docs.microsoft.com/de-de/windows/mixed-reality/coordinate-systems-in-unity

    Some debug infos:
    Debug.Log("XRSettings.loadedDeviceName: " + XRSettings.loadedDeviceName); // "WindowsMR"
    Debug.Log("XRSettings.enabled: " + XRSettings.enabled); // true
    Debug.Log("XRSettings.isDeviceActive: " + XRSettings.isDeviceActive); // true
    Debug.Log("XRDevice.isPresent: " + XRDevice.isPresent); // true
    Debug.Log("XRDevice.model: " + XRDevice.model); // "Microsoft HoloLens"

    I'm using Unity 2017.4.13f1
     
  7. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
    To my understanding, I think you might be misreading the Microsoft documentation you linked above - it's not very clear on first reading, but what it's saying there is that for HoloLens, you need to focus on "word-scale" experiences rather than relying on changing behavior through SetTrackingSpaceType.

    That said, I'd be happy to try to point you in the right direction for whatever problem it is that you're trying to solve. What is it you're trying to accomplish? What is the behavior you're looking for with your camera/head-tracking? (A seemingly locked position, so only rotation of your head feels like it's being taken into account? A "spring"y content placement, similar to the Unity splash screen on HoloLens and other stereoscopic devices? Something else entirely?)
     
  8. holorider

    holorider

    Joined:
    Oct 24, 2018
    Posts:
    3
    Sorry for the late response.
    For clarification:
    https://docs.microsoft.com/en-us/windows/mixed-reality/coordinate-systems#device-support
    says, that the HoloLens supports the so called attached frame of reference.

    I'm building an app for the usage in the car. Of course, I'm not driving by myself, my colleague drives the car. I'm sitting on a passenger seat. We will use the HoloLens as a simple AR-glasses to display something around the user. We need no spatial mapping.
    Yes, the orientation-only experience with the rotation tracking only (like the 360-degree video use case) sounds perfect.
     
  9. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    holorider likes this.
  10. holorider

    holorider

    Joined:
    Oct 24, 2018
    Posts:
    3
    Thanks for the hint @JasonCostanza
    With
    HolographicSettings.ReprojectionMode = HolographicSettings.HolographicReprojectionMode.OrientationOnly;
    I get the expected console output:
    Debug.Log(HolographicSettings.ReprojectionMode); // OrientationOnly
    Now, I have to test it.
     
  11. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    I'm really hoping that set tracking space type to stationary will work for most all devices, because I really don't like the idea of people using room scale when it shouldn't be used.