icub-tech-iit / urdf-modifiers

BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

Inertia modified by linkModifier gets hardcoded to 0.01 indipendently of link geometry #17

Open traversaro opened 2 years ago

traversaro commented 2 years ago

Due to the line https://github.com/icub-tech-iit/urdf-modifiers/blob/0cca96787013c444ec8ae8c390042c07465a2909/urdfModifiers/core/linkModifier.py#L200 if the inertia is lower then 0.01 the inertia of the new model is hardcoded to the 0.01 .

This is quite an high value as even a big link such as the root_link of the iCub3 has inertia in the order of magnitude of 1e-3, not 1e-2, see https://github.com/robotology/icub-models/blob/ab11b8cb8799b85a8805be95e3d66e7c6c7585ff/iCub/robots/iCubGenova09/model.urdf#L6 . Ideally this logic should be made at least optional.

cc @GrmanRodriguez @Nicogene @AlexAntn @CarlottaSartore @fabiodinatale

GrmanRodriguez commented 2 years ago

This was added because when inertia values are too low, the model collapses on itself (see here). We saw this behavior happen enough times when applying it to stickBot that we deemed it necessary to add this restriction.

However, I agree that 0.01 is too high (even the link I sent suggests 0.001) and that we can make it optional.

traversaro commented 2 years ago

This was added because when inertia values are too low, the model collapses on itself (see here).

Just to clarify why it is convenient to make this configurable, the "the model collapses on itself" does not only depend on the inertia values, but also on the specific simulator that is too sensitive to the stiffness of the differential equation (in your case, I guess Gazebo with ODE and default physics settings). The same URDF model that is collapsing on itself in Gazebi with ODE and default physics settings may work perfect fine with another simulator that for example uses a variable step integrator or even just Gazebo with other physics settings. See https://github.com/robotology/icub-models/issues/121 for a bit more details on this.