idyntree icon indicating copy to clipboard operation
idyntree copied to clipboard

Automatically compute inertial parameters from link shapes

Open traversaro opened this issue 6 years ago • 8 comments

Inertial parameters (mass, center of masses and inertia matrices) of rigid bodies are a fundamental quantity in model-based control and simulation of robots that can be considered as composed by rigid bodies.

These parameters are typically obtained from CAD models of the robot used for designing and manufacturing the robot (see for example http://wiki.icub.org/wiki/Creo_Mechanism_to_URDF) or identified from sensor measurements on the robot.

However in practice a good-enough method to obtain inertial parameters, if the total mass of the robot is known and some meshes of its links are available, is to assume that the robot has constant density and compute the inertial parameters as a consequence of this (more details will arrive).

traversaro avatar Jun 28 '18 15:06 traversaro

I imagine three main use cases:

  • You know the total robot mass, and you want to compute 3D inertia and center of mass for each link
  • You know the mass of each link, and you want to compute 3D inertia and center of mass for each link
  • You know the mass and the center of mass of each link, and you want to compute the 3D inertia of each link

In the third case, I do not think there is an easy way to use the center of mass information position to aid the 3D inertia computation, but a nice debug check would be compare the center of mass position computed from shapes + uniform density assumption and the "known" one.

traversaro avatar Jul 04 '18 07:07 traversaro

For the actual implementation, the computation necessary for compute the center of mass and 3D inertia of basic shapes (at this moment: Sphere, Box, Cylinder) are just the basic formulas that you can find in any mechanics textbook (see https://en.wikipedia.org/wiki/List_of_moments_of_inertia#List_of_3D_inertia_tensors for an informal reference).

Regarding meshes, the issue is more complicated. We currently do not support reading meshes in memory (we just supported saving their filesystem location as part of the ExternalMesh class, that was used for the visualizer). Support for that can be added using assimp. Once the meshes are loaded in memory, it should be possible to use the Mirtich's algorithm to compute the inertial parameters of the mesh (note: the C implementation is released as public domain). Note that this is the same algorithm implemented in MeshLab, a tool that is typically used for doing this kind of computation offline ( http://gazebosim.org/tutorials?tut=inertia ).

traversaro avatar Jul 04 '18 07:07 traversaro

A preliminary version of what was proposed in this issue was introduced in https://github.com/robotology/idyntree/pull/580 , even at the moment we only support computing the inertial parameters assuming that the geometry of the link is the axis aligned bounding box of the actual shape.

traversaro avatar Jan 23 '20 11:01 traversaro

Related SDFormat issue: https://bitbucket.org/osrf/sdformat/issues/176/allow-a-subset-of-instead-of .

traversaro avatar Jan 23 '20 11:01 traversaro

Related Drake issue: https://github.com/RobotLocomotion/drake/issues/13033 .

traversaro avatar Apr 10 '20 15:04 traversaro

Related script by @AndrejOrsula: https://github.com/AndrejOrsula/panda_ign/blob/master/scripts/estimate_inertial_properties.py

traversaro avatar Mar 01 '21 10:03 traversaro

Realted script: https://github.com/vonunwerth/MeshLabInertiaToURDF/blob/master/main.py .

traversaro avatar Jun 29 '22 09:06 traversaro