Skip to main content
Up and Coming
August 15, 2014

Porting to new SDK

Hi there, I'm having trouble porting to the new SDK

I have this

extern "C"
{
#include "../include/ovr_freepie.h"
}
#include <OVR.h>

using namespace OVR;

ovrHmd HMD;

int ovr_freepie_init(float dt)
{
ovr_Initialize();
HMD = ovrHmd_Create(0);
if (!HMD) return 1;

ovrHmd_SetEnabledCaps(HMD, ovrHmdCap_DynamicPrediction);

ovrHmd_ConfigureTracking(HMD, ovrTrackingCap_Orientation |
ovrTrackingCap_MagYawCorrection |
ovrTrackingCap_Position, 0);

return 0;
}

int ovr_freepie_reset_orientation()
{
ovrHmd_RecenterPose(HMD);
return 0;
}

int ovr_freepie_read(ovr_freepie_3dof *output)
{
ovrTrackingState ts = ovrHmd_GetTrackingState(HMD, ovr_GetTimeInSeconds());

Posef pose = ts.HeadPose.ThePose;

pose.Rotation.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&output->yaw, &output->pitch, &output->roll);

return 0;
}

int ovr_freepie_destroy()
{
ovrHmd_Destroy(HMD);
ovr_Shutdown();

return 0;
}


It takes several seconds until init returns and then I get a null HMD, so I guess something in the library is timing out?
I got the DK1

I'm getting this in debug

Debug: Performance timer Vista flag = 1
Debug: [NetClient] OnConnectionAttemptFailed
Debug: [NetClient] OnConnectionAttemptFailed
Debug: [NetClient] OnConnectionAttemptFailed

    22 replies

    Up and Coming
    August 15, 2014
    Have you installed the Oculus runtime and restarted your computer?
    Participant
    August 15, 2014
    Same here :/
    Up and Coming
    August 15, 2014
    Ops, missed that new requirement :D

    Now I am getting

    Debug: Performance timer Vista flag = 1
    Display Found MONITOR\OVR0001\{4d36e96e-e325-11ce-bfc1-08002be10318}\0009 - \\.\
    DISPLAY1\Monitor1
    Uninitialized Hmd
    Up and Coming
    August 16, 2014
    Anyone knows what I am doing wrong?
    Up and Coming
    August 18, 2014
    We want to support DK2 in FreePIE so would be great if someone from Oculus could share som light over why this is not working for me, thanks
    Participant
    August 18, 2014
    Hi CyberVillain,
    just a guess: could it be waiting for some component of the DK2 to answer?
    I have both, DK1 & DK2, maybe you could give me copy of your new Freepie so i can give it a try?
    Up and Coming
    August 18, 2014
    Thanks, I have let a DK2 user try it and he got the same result, but please try.
    Its a standalone exe, see attachment, make sure you have VC++ redist 2013
    Participant
    August 18, 2014
    Debug: Performance timer Vista flag = 1
    Uninitialized Hmd
    Failed to init

    and sometimes i see

    ...Debug>test.exe
    Debug: Performance timer Vista flag = 1
    Debug: [NetClient] Connected to a server running version 1.0.0 (my version=1.0.0)
    Uninitialized Hmd
    Failed to init

    Tried all variations of direct HMD access, extended Desktop to HMD, with running or stopped service, no luck :(
    Up and Coming
    August 18, 2014
    Yeah, I would really much like to know what Iam doing wrong in my Code, cant see that Iam doing something wrong
    Up and Coming
    August 18, 2014
    What does ovrHmd_Detect() return?
    Kaetemi | Ryzom Core MMORPG Engine