rdiankov/openrave — pull request #235 by robEllenberg (2012-10-30 04:23:39+00:00)
Title: Fixes mimicgeom / total mass issue with kinbody reader.

The current version of the Kinbody XML reader assumes that when "mimicgeom" is specified as the mass type, the user has specified density (not total mass). Setting a total mass has no effect because the fTotalMass property is not read in this mode. My fix adds a new enum flag, which allows the code to correctly use either totalmass or density.

The method:
1. Calculate each geom's mass assuming a dummy density (1000kg/m^3)
2. Add all geom masses to find a total dummy mass
3. Scale each geom's mass by the ratio of the assigned mass over the dummy mass.
4. Sum and store the totalmass property.

It would likely be more elegant or simple to work directly with volume,
but this method was quick and easy given the existing code. Hope this helps!

-Rob