Skip to content

Respect correctly assignedMass even if a link inertia is specified via mirroredInertia #59

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

Closed
wants to merge 1 commit into from

Conversation

traversaro
Copy link
Member

This ensure that if a link has both assignedMass and mirroredInertia, assignedMass is not ignored.

Fix #58 .

This is not the perfect fix as ideally we would like for mirroredInertia to get the assignedMass from the link from which we copy the inertia parameters. However, this requires some more code changes that I do not have the time to do now, especially given that the work on the lab has been shifted to https://github.com/icub-tech-iit/creo2urdf .

@traversaro
Copy link
Member Author

If someone wants to work on a more definitive solution I would be happy to guide him in the development of this feature.

@HosameldinMohamed
Copy link

I tried the solution and I'm not sure about the results I've got:

For the YAML that contains:

assignedMasses:
  l_upper_arm : 1.8703
  r_upper_arm : 1.8703

mirroredInertia:
  - mirroredLink: l_upper_arm
    originalLink: r_upper_arm
    simmetryReferenceLink: root_link
    symmetryPlane: xz

Translated with the version from this branch.

I got the following URDF:

  <link name="l_upper_arm">
    <inertial>
      <mass value="1.8703"/>
      <inertia ixx="0.0033015393386908592" ixy="-1.1642719938717833e-05" ixz="0.00024864845503107756" iyy="0.0034295590589069995" iyz="0.00022475902176983257" izz="0.001479994626864221"/>
    </inertial>
  </link>

  <link name="r_upper_arm">
    <inertial>
      <mass value="1.8703"/>
      <inertia ixx="0.0033005254762146084" ixy="-7.856912537486065e-05" ixz="0.0005314736736640653" iyy="0.003275179877659797" iyz="0.00032042055112711576" izz="0.0016353876705876744"/>
    </inertial>
  </link>

I'm not sure why I got these numbers, even if I apply the scaling implemented in the code, for example:

>> newMass = 1.8703

newMass =

    1.8703

>> oldMass = 1.6756

oldMass =

    1.6756

>> inertiaScaling = newMass / oldMass

inertiaScaling =

    1.1162

>> r_ixx = 0.0033005254762146084

r_ixx =

    0.0033

>> l_ixx = r_ixx * inertiaScaling

l_ixx =

   0.003684037239296

@HosameldinMohamed
Copy link

ideally we would like for mirroredInertia to get the assignedMass from the link from which we copy the inertia parameters. However, this requires some more code changes that I do not have the time to do now

I could check the code to see how much effort it takes to do it!

@traversaro
Copy link
Member Author

I'm not sure why I got these numbers, even if I apply the scaling implemented in the code, for example:

Just to understand, what is the wrong thing in that numbers?

@HosameldinMohamed
Copy link

I'm not sure why I got these numbers, even if I apply the scaling implemented in the code, for example:

Just to understand, what is the wrong thing in that numbers?

I expected i_xx of l_upper_arm to be equal to the one in r_upper_arm multiplied by inertiaScaling. As I understood from your implementation in the PR. But I didn't get that result.

@traversaro
Copy link
Member Author

Any update on this PR @HosameldinMohamed ? If you do not plan to work on this anymore, I guess we can close this PR.

@HosameldinMohamed
Copy link

Any update on this PR @HosameldinMohamed ? If you do not plan to work on this anymore, I guess we can close this PR.

No updates yet @traversaro, I would attempt it in a few days, otherwise I'll close it then.

@traversaro
Copy link
Member Author

Ok, no hurry!

@HosameldinMohamed
Copy link

Any update on this PR @HosameldinMohamed ? If you do not plan to work on this anymore, I guess we can close this PR.

No updates yet @traversaro, I would attempt it in a few days, otherwise I'll close it then.

In the end, I don't think I'll be working on this PR anymore. So I guess we can close it.

@traversaro
Copy link
Member Author

Any update on this PR @HosameldinMohamed ? If you do not plan to work on this anymore, I guess we can close this PR.

No updates yet @traversaro, I would attempt it in a few days, otherwise I'll close it then.

In the end, I don't think I'll be working on this PR anymore. So I guess we can close it.

Ok, thanks!

@traversaro traversaro closed this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using mirroredInertia mirrors also the mass value, copying the value from the XML file
2 participants