Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect inertias generated in the ergoCubSN001 model #224

Closed
giotherobot opened this issue Mar 8, 2024 · 5 comments · Fixed by #226
Closed

Incorrect inertias generated in the ergoCubSN001 model #224

giotherobot opened this issue Mar 8, 2024 · 5 comments · Fixed by #226
Assignees
Labels
domain-software Related to Software team-fix Related to Team Fix

Comments

@giotherobot
Copy link
Contributor

giotherobot commented Mar 8, 2024

While trying to import the model in mujoco I discovered a problem in the inertia orientation of the ergoCubSN001 model.

Then with @traversaro we checked also in Gazebo the original model without modification and indeed the inertias have an incorrect orientation wrt the links:

image
image

This might be a problem of the creo to urdf conversion?

@traversaro
Copy link
Member

traversaro commented Mar 8, 2024

I guess the most interesting one are the one in the finger. The header is almost a ball, so its principal axis are indeed quite sensitive to small mass distribution discrepancies. Instead, the one in the fingers seems to be actually wrong.

As mentioned by @giotherobot, probably there is something wrong either in creo --> iDynTree::Model conversion contained in https://github.com/icub-tech-iit/creo2urdf, or in the iDynTree:Model --> URDF conversion contained in https://github.com/robotology/idyntree/blob/master/src/model_io/codecs/src/URDFModelExport.cpp .

@traversaro
Copy link
Member

iDynTree:Model --> URDF conversion contained in https://github.com/robotology/idyntree/blob/master/src/model_io/codecs/src/URDFModelExport.cpp .

Looking into this, I guess the probability of those being wrong seems low, mainly as the orientation of the inertia is hardcoded to the identity in https://github.com/robotology/idyntree/blob/master/src/model_io/codecs/src/URDFModelExport.cpp#L89, as in iDynTree the inertia is always oriented like the link frame.

@traversaro
Copy link
Member

Looking at creo2urdf, the relevant code is:

In particular, it seems that the mass_prop->GetGravityCenter() returns the COM expressed w.r.t. to root link of the model, and that is handled in https://github.com/icub-tech-iit/creo2urdf/blob/e4419a69217f384bb793fa6ae11c84009ac17723/src/creo2urdf/src/Creo2Urdf.cpp#L393 . However, for the same reason perhaps the inertia is expressed with the orientation of the root link? If that is the case, the inertia should be rotated to be expressed in the link frame before being passed to iDynTree's fromRotationalInertiaWrtCenterOfMass method, and that is currently not done.

@traversaro
Copy link
Member

Looking at creo2urdf, the relevant code is:

* https://github.com/icub-tech-iit/creo2urdf/blob/e4419a69217f384bb793fa6ae11c84009ac17723/src/creo2urdf/src/Creo2Urdf.cpp#L150

* https://github.com/icub-tech-iit/creo2urdf/blob/e4419a69217f384bb793fa6ae11c84009ac17723/src/creo2urdf/src/Creo2Urdf.cpp#L375-L402

In particular, it seems that the mass_prop->GetGravityCenter() returns the COM expressed w.r.t. to root link of the model, and that is handled in https://github.com/icub-tech-iit/creo2urdf/blob/e4419a69217f384bb793fa6ae11c84009ac17723/src/creo2urdf/src/Creo2Urdf.cpp#L393 . However, for the same reason perhaps the inertia is expressed with the orientation of the root link? If that is the case, the inertia should be rotated to be expressed in the link frame before being passed to iDynTree's fromRotationalInertiaWrtCenterOfMass method, and that is currently not done.

To clarify what I was suggesting, I wrote it down the fix I have in mind in icub-tech-iit/creo2urdf#83 .

@Nicogene Nicogene added team-fix Related to Team Fix domain-software Related to Software labels Mar 11, 2024
@fils99
Copy link

fils99 commented Mar 13, 2024

Hi @Nicogene @traversaro and @giotherobot, I also checked the legs and the problem seems to be also there

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-software Related to Software team-fix Related to Team Fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants