Search Unity

GetLocalPosition/Rotation results different results between Oculus and OpenVR SDKs

Discussion in 'AR/VR (XR) Discussion' started by Iron-Warrior, Dec 28, 2019.

  1. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Having an issue here where I get a different position/orientation with the following code

    Code (csharp):
    1. transform.position = InputTracking.GetLocalPosition(XRNode.RightHand);
    2. transform.rotation = InputTracking.GetLocalRotation(XRNode.RightHand);
    ...based on whether I am using the Oculus SDK or OpenVR, for an Oculus Touch CV1 controller. Now, a workaround exists (I can just take the difference between the position/orientation before/after swapping SDKs at runtime), but I was wondering if this is working as intended or a bug. I'd like to support as many devices as possible for my project, so nice to know if things will change here.
     
  2. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I'm running into the same issue. Did you ever figure this out?
     
  3. dwatt-hollowworldgames

    dwatt-hollowworldgames

    Joined:
    Apr 26, 2019
    Posts:
    104
    could it be due the fact that the two sdk put 0,0,0 in different places. ie one on the floor and one in the middle of the space. Also openvr always tilts the hands up 40 degrees or so.
     
  4. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Not really. Ended up just recording the position/orientation of controllers, then the next frame swapping device drivers and comparing the differences to get the exact offsets, which we apply at runtime.

    ¯\_(ツ)_/¯