[ODE] Combining inertias

Gregor Veble gregor.veble at uni-mb.si
Tue Dec 4 02:52:01 2001


On Mon, 3 Dec 2001, Russ Smith wrote:

> 
> > Not specifically an ODE question: how does one combine the
> > inertias of different bodies? Say I have two boxes connected by
> > a cylinder. I have inertias for all three, but now I need to
> > combine them into a single rigid body. Can I just add the
> > components of the inertia matrices?
> 
> yes - but getting the updated center of mass is more tricky.
> there is an ODE function to do this:
> 
> 	void dMassAdd (dMass *a, const dMass *b);
> 
> check the latest (CVS) docs. also look at the test_boxstack
> example, which uses this function for its composite objects.
> 
> russ.
> 

Hi,

I am assuming these are perfectly rigidly connected bodies one is 
considering.

First one needs to find the total center of mass, as explained by
Russ. In vector form, this is given by 

R = (sum)_k m_k * r_k / ( (sum)_k m_k)

where r_k are the vectors to the centers of mass of individual objects
and m_k their masses.

Then indeed the matrix elements of inertias (be sure that they are
defined in the same frame of reference) must be added, however, additional
contributions come from the masses themselves; for the matrix element J_ij
of the total inertia each mass m_k contributes an additional 

m_k * (r_k - R)_i * (r_k - R)_j, 

where (r_k - R)_i are the components of the vector from the center of mass
of the total joint body as calculated before to the center of mass of the
k-th body.

If I am wrong, someone jump in and save me :)

-Gregor