Box 2D, revolute joint effect mass matrix

Please don't post Bullet support questions here, use the above forums instead.
bendaowei
Posts: 3
Joined: Fri Jun 20, 2008 4:05 pm

Box 2D, revolute joint effect mass matrix

Post by bendaowei »

J = [ -I, -(-r1.y i, r1.x j), I , (-r2.y i, r2.x j)]
K = J M-1 JT
And the result is
K = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)]
= [1/m1+1/m2 0 ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y]
[ 0 1/m1+1/m2] [-r1.x*r1.y r1.x*r1.x] [-r1.x*r1.y r1.x*r1.x]

My question is how K is calculated?
(More detailed:
how -(-r1.y i, r1.x j) * -(-r1.y i, r1.x j)
becomes
[r1.y*r1.y -r1.x*r1.y]
[-r1.x*r1.y r1.x*r1.x] )

Thanks a lot. (plus: I have understood how distance joint effect mass matrix is calculated.)
Last edited by bendaowei on Thu Apr 16, 2009 2:10 am, edited 2 times in total.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Re: Box 2D, revolute joint effect mass matrix

Post by Erin Catto »

bendaowei wrote: how -(r1.y i, r1.x j) * -(r1.y i, r1.x j)
becomes
[r1.y*r1.y -r1.x*r1.y]
[-r1.x*r1.y r1.x*r1.x] )
You need to use the outer product: v * transpose(v)

Code: Select all

[ r1.y] * [r1.y, -r1.x]
[-r1.x]
In 2D skew(r) becomes a 2D column vector (the first 2 rows of the 3rd column in the 3D skew matrix).
bendaowei
Posts: 3
Joined: Fri Jun 20, 2008 4:05 pm

Re: Box 2D, revolute joint effect mass matrix

Post by bendaowei »

You need to use the outer product: v * transpose(v)
This is very true.

Code: Select all

J v = [1 0 -r.y][v.x] = [v.x - r.y * omega, v.y + r.x * omega]
      [0 1  r.x][v.y]
                [omega]

Code: Select all

J JT = [1 0 -r.y][1    0] = [1 + r.y  * r.y][0 + -r.y * r.x]
       [0 1  r.x][0    1]   [0 + -r.y * r.x][1 + r.x  * r.x]
                 [-r.y r.x]
Thanks a lot