Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jakeslack27's avatar
jakeslack27
Honored Guest
12 years ago

DK2 Initial Pos

Hi,

I'm just wondering if there is an official word on the initial position for the DK2's positional tracking? Is the 'zero' local position of the OVRCameras set when the Oculus is plugged in, per when the game is launched or is it a constant global from the camera (i.e always 3 foot away from the camera in real world). I assumed it was global space but I'm getting inconsistent behaviour? Not sure if this is a problem in software or something I've overlooked?

Thanks for the help!

7 Replies

Replies have been turned off for this discussion
  • From the docs:

    By default the tracking origin is located one meter away from the camera in the direction of the optical axis but with the same height as the camera. The default origin orientation is level with the ground with the negative z axis pointing towards the camera. In other words, a headset yaw angle of zero corresponds to the user looking towards the camera.

    This can be modified using the API call ovrHmd_RecenterPose which resets the tracking origin to the headset’s current location, and sets the yaw origin to the current headset yaw value. Note that the tracking origin is set on a per application basis and so switching focus between different VR apps will switch the tracking origin also.
  • That's how it is in In DerGrosse Gottlieb, the zero position is directly in front of the camera, about 3 feet back. That seats you in the chair at the start. If I start the game in any other position, I won't be in the chair and have to press spacebar to reset. However, that is not the case with the 0.4.1 oculus world demo. My starting eye position i.e. the zero local position is always about 2 feet back from the IR camera and offset about 1 foot to the right. If I start the demo with the hmd in any other place the view jumps to the actual location of the HMD (relative to that local zero) as soon as the camera syncs.
  • Ok, so from my understanding the final local-position of the Unity Cameras is the actual real-world global position of the Oculus in relation to the IR Cam. The orientation looks spot on and always seems to be consistent but I do find I get inconsistencies with the pos tracking (sometime too low, sometimes too high). Looks like grodenglaive has something similar, I'm also running 0.4.1.

    I'll look into ovrHmd_RecenterPose, maybe a hard reset when the game starts up is the way to go.
  • Hi,
    I'm having an issue with this.

    I'm trying to reset the position of the headset at the start of my level. (it's very important that all players start in the exact same in game location)

    I can't see how to access the API call ovrHmd_RecenterPose in Unity. What library does it belong to?

    Thanks,
    -Matt
  • Try adding something like this (press RETURN to reset the view):


    void Update () {
    if (Input.GetKey(KeyCode.Return) ) {
    print("Reset Orientation: " + OVRDevice.ResetOrientation() );
    }
    }
  • QLayer's avatar
    QLayer
    Honored Guest
    For anyone trying to fix this in the DK2 SDK 0.4.3, and disabling "ResetTrackerOnLoad" not working you can fix this by adding this line on the OVRDisplay constructor :

    public OVRDisplay() {
    if(OVRManager.instance.resetTrackerOnLoad)
    RecenterPose();
    ...