I've been using VRPN with tracking tools to get positional data (x,y,z) for a while now and everything is going well. I recently started to used the angular data (y,p,r) and have been running into some problems. I'm reciving the data and converting the quaterion data into Euler angles via the following code.
vrpn_TRACKERCB t is passed to my callback.
RAD2DEG = (180/3.141592653589793)
double x = t.pos[0];
double y = t.pos[1];
double z = t.pos[2];
q_vec_type yawPitchRoll;
q_to_euler(yawPitchRoll, t.quat);
double y = yawPitchRoll[0] * RAD2DEG;
double p = yawPitchRoll[1] * RAD2DEG;
double r = yawPitchRoll[2] * RAD2DEG;
The received x,y,z match the values being reported by Tracking Tools exactly. The angular values don't match however. Any suggestions as to what I'm doing wrong?
VRPN angular data
Re: VRPN angular data
When you convert an orientation to Euler's you have to be mindful of what assumptions the approach your using is making. Namely, what order are the angles applied, what coordinate system (left or right handed), and are the angles absolute or relative.
As a result Euler angles are a bit of a hassle because converting to/from can be a hassle.
Tracking Tools outputs in Euler's in axis order XYZ, right-handed coordinate system, absolute angles.
It's ok if they don't match yours, it just means you're making different assumptions so long as it's working for you.
As a result Euler angles are a bit of a hassle because converting to/from can be a hassle.
Tracking Tools outputs in Euler's in axis order XYZ, right-handed coordinate system, absolute angles.
It's ok if they don't match yours, it just means you're making different assumptions so long as it's working for you.