Orientation Problem: Roll / Pitch Axis are mixed! Pls help
Im building a system, where i need to extract the Orientation of the Oculus via C++. My code is very simple an mostly out of the Guide.
The Problem is, that then i test it the Axis Z and X are mixed together.
e.g. If i roll ( z- axis ) the Oculus the Pitch ( x- axis ) parameter is changing too and vice versa.
=> turning the Oculus by ~30° (z - axis) changes the values of:
x~0.00 to x~0.08
and
z~ 0 to z~ -0.15
How can i seperate them?
i need x,z,y parameters, which are independ, so i can extrat the angles, to make my system work.
is there another way to get the orientation angles?
The Problem is, that then i test it the Axis Z and X are mixed together.
e.g. If i roll ( z- axis ) the Oculus the Pitch ( x- axis ) parameter is changing too and vice versa.
=> turning the Oculus by ~30° (z - axis) changes the values of:
x~0.00 to x~0.08
and
z~ 0 to z~ -0.15
How can i seperate them?
i need x,z,y parameters, which are independ, so i can extrat the angles, to make my system work.
is there another way to get the orientation angles?
ovr_Initialize();
if(!HMD){
HMD = ovrHmd_Create(0);
if(!HMD){
cout<<"Oculus Rift not detected!"<<endl;
}
if(HMD->ProductName[0] == '\0'){
cout<<"Oculus Rift detected,display not enabled"<<endl;
}
}
ovrHmd_ConfigureTracking(HMD, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, 0);
Sleep(500); //Wait on VR-to respond
ovrTrackingState ts = ovrHmd_GetTrackingState(HMD, ovr_GetTimeInSeconds());
ovrPosef pose;
if(ts.StatusFlags & (ovrStatus_OrientationTracked | ovrStatus_PositionTracked)){
while(1){
ts = ovrHmd_GetTrackingState(HMD, ovr_GetTimeInSeconds());
pose = ts.HeadPose.ThePose;
cout << "X:" << pose.Orientation.x ;
cout << "Y:" << pose.Orientation.y ;
cout << "Z:" << pose.Orientation.z ;
}
