Barenbrug Hinge
Posted: Thu Mar 15, 2007 4:21 am
Hey all! After having such great success with the fixed orientation joint from Barenbrug's thesis, I decided to implement the hinge constraint from the thesis. I'm going to give a little background for those not familiar with the derivation and give a break down of what the jacobian looks like. My current implemention is wrong and I'm wondering if anyone could check my jacobian for me.
Instead of a single anchor point plus a line he suggests using 2 anchor points: P1 and P2.
Let:
P1A,P2A,P1B,P2B are the current P1 and P2's transformed by the bodies A and B.
L = P1A-P2A
T1,T2 = orthogonal basis of L.
RP1 = P1A - P1B
RP2 = P2A - P2B
C[0] = T1 . RP1
C[1] = T2 . RP1
C[2] = L . RP1
C[3] = T1 . RP2
C[4] = T2 . RP2
dC[0]/dt = T1 . (vA + wA x P1A_local - vB - wB x P1B_local)
etc..
First row of J looks like:
T1.x
T1.y
T1.z
T1.z * P1A.y - T1.y * P1A.z
T1.x * P1A.z - T1.z * P1A.x
T1.y * P1A.x - T1.x * P1A.y
-T1.x
-T1.y
-T1.z
-T1.z * P1A.y + T1.y * P1A.z
-T1.x * P1A.z + T1.z * P1A.x
-T1.y * P1A.x + T1.x * P1A.y
The rest of the rows follow the same pattern.
Has anyone gone down this road?
Instead of a single anchor point plus a line he suggests using 2 anchor points: P1 and P2.
Let:
P1A,P2A,P1B,P2B are the current P1 and P2's transformed by the bodies A and B.
L = P1A-P2A
T1,T2 = orthogonal basis of L.
RP1 = P1A - P1B
RP2 = P2A - P2B
C[0] = T1 . RP1
C[1] = T2 . RP1
C[2] = L . RP1
C[3] = T1 . RP2
C[4] = T2 . RP2
dC[0]/dt = T1 . (vA + wA x P1A_local - vB - wB x P1B_local)
etc..
First row of J looks like:
T1.x
T1.y
T1.z
T1.z * P1A.y - T1.y * P1A.z
T1.x * P1A.z - T1.z * P1A.x
T1.y * P1A.x - T1.x * P1A.y
-T1.x
-T1.y
-T1.z
-T1.z * P1A.y + T1.y * P1A.z
-T1.x * P1A.z + T1.z * P1A.x
-T1.y * P1A.x + T1.x * P1A.y
The rest of the rows follow the same pattern.
Has anyone gone down this road?