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

    Participant
    August 20, 2014
    "CyberVillain" wrote:
    And that also gives some kind of output from the IMU sensors? Whats going on their? Shouldnt it return zero on a DK1?


    Those are neck modeling values that pass back as translations on the DK1
    Up and Coming
    October 1, 2014
    "brantlew" wrote:
    "CyberVillain" wrote:
    And that also gives some kind of output from the IMU sensors? Whats going on their? Shouldnt it return zero on a DK1?


    Those are neck modeling values that pass back as translations on the DK1


    Sorry for late reply, aha, thanks for the input.