Page 1 of 1

Switch coordinate frame of angular velocity and inertia

Posted: Sat Jul 21, 2012 7:39 pm
by kingchurch
Let's say we have the angular velocity of a rigid body in its local coordinate frame in the form of (Rx, Ry, Rz) how to map it to a different coordinate frame (the world CF or another CF on a different location of the object? I assume you cannot simply multiply the transform matrix of the CF.

Similar question for inertia tensor 3x3 matrix for 3D rigid body: how to map it from the local CF to a different CF?

My actual use case is to map angular velocity and moment of inertia from the object space to the joint space that is anchored at an offset from the COM of the object.

Thanks!

Re: Switch coordinate frame of angular velocity and inertia

Posted: Sat Jul 21, 2012 9:33 pm
by mikeshafer
So I think this might help you. GPG4 page 247 talks about a ball and socket joint. It states:
The shifting rule says that if a constraint is specified for points g1 and g2 relative to bodies 1 and 2, like this:

a1.dot(p1 + g1) + q1.dot(w1) + a2.dot(p1 + g2) + q2.dot(w2) = c

then the equivalent POR-relative constraint is

a1.dot(p1) + (q1 + g1.cross(a1)).dot(w1) + a2.dot(p2) + (q2 + g2.cross(a2)).dot(w2) = c

This shifting rule correctly trades off linear and angular velocity at the POR. Applying this to the ball-and-socket joing for each u_i gives

u_i.dot(p1) + (g1.cross(u_i)).dot(w1) - u_i.dot(p2) - (g2.cross(u_i)).dot(w2)
I'll go ahead and describe the variables:

a1/u_i = axis/basis vectors
p1/p2 = COM velocities
g1/g2 = vectors pointing from COM to where ball and socket meet
w1/w2 = angular velocities

I should've retyped p1/p2 as v1/v2 but that's how the author has it (with a dot on top). That's about all I know. I'm working on a rag-doll physics system and I didn't need to translate the moment of inertia. Do you have a block solver set up? I recommend reading http://erwincoumans.com/ftp/pub/test/ph ... namics.pdf.

HTH,
Mike