Tracking Tools + VRPN
Posted: Fri Apr 08, 2011 7:34 am
Hello,
I'm using Tracking Tools 2.3.1 (Right handed system) & VRPN. I would like to obtain the position of a target point relative to the pivot point of my rigid body. First, I tried using the offsets of Tracking Tools and it worked. Now, I�m using the quaternion and the position of the pivot point (VRPN) but, sometimes, the position of the target point is extremely bad.
The equations which I use are the following ones:
[Xtarget] = R1*[Xpivot]+R2*[Ypivot]+R3[Zpivot]+[XOffset]
[Ytarget] = R4*[Xpivot]+R5*[Ypivot]+R6[Zpivot]+[YOffset]
[Ztarget] = R7*[Xpivot]+R8*[Ypivot]+R9[Zpivot]+[ZOffset]
R1 = 1 - 2*(t.quat[1]*t.quat[1]+t.quat[2]*t.quat[2]);
R2 = 2*(t.quat[0]*t.quat[1]-t.quat[3]*t.quat[2]);
R3 = 2*(t.quat[0]*t.quat[2]+t.quat[3]*t.quat[1]);
R4 = 2*(t.quat[0]*t.quat[1]+t.quat[3]*t.quat[2]);
R5 = 1 - 2*(t.quat[0]*t.quat[0]+t.quat[2]*t.quat[2]);
R6 = 2*(t.quat[1]*t.quat[2]-t.quat[3]*t.quat[0]);
R7 = 2*(t.quat[0]*t.quat[2]-t.quat[3]*t.quat[1]);
R8 = 2*(t.quat[1]*t.quat[2]+t.quat[3]*t.quat[0]);
R9 = 1 - 2*(t.quat[0]*t.quat[0]+t.quat[1]*t.quat[1]);
What's the problem?
Thanks,
araa
I'm using Tracking Tools 2.3.1 (Right handed system) & VRPN. I would like to obtain the position of a target point relative to the pivot point of my rigid body. First, I tried using the offsets of Tracking Tools and it worked. Now, I�m using the quaternion and the position of the pivot point (VRPN) but, sometimes, the position of the target point is extremely bad.
The equations which I use are the following ones:
[Xtarget] = R1*[Xpivot]+R2*[Ypivot]+R3[Zpivot]+[XOffset]
[Ytarget] = R4*[Xpivot]+R5*[Ypivot]+R6[Zpivot]+[YOffset]
[Ztarget] = R7*[Xpivot]+R8*[Ypivot]+R9[Zpivot]+[ZOffset]
R1 = 1 - 2*(t.quat[1]*t.quat[1]+t.quat[2]*t.quat[2]);
R2 = 2*(t.quat[0]*t.quat[1]-t.quat[3]*t.quat[2]);
R3 = 2*(t.quat[0]*t.quat[2]+t.quat[3]*t.quat[1]);
R4 = 2*(t.quat[0]*t.quat[1]+t.quat[3]*t.quat[2]);
R5 = 1 - 2*(t.quat[0]*t.quat[0]+t.quat[2]*t.quat[2]);
R6 = 2*(t.quat[1]*t.quat[2]-t.quat[3]*t.quat[0]);
R7 = 2*(t.quat[0]*t.quat[2]-t.quat[3]*t.quat[1]);
R8 = 2*(t.quat[1]*t.quat[2]+t.quat[3]*t.quat[0]);
R9 = 1 - 2*(t.quat[0]*t.quat[0]+t.quat[1]*t.quat[1]);
What's the problem?
Thanks,
araa