robotology / simmechanics-to-urdf

Script for converting simmechanics XML files to URDF
34 stars 8 forks source link

Using `mirroredInertia` mirrors also the mass value, copying the value from the XML file #58

Open HosameldinMohamed opened 11 months ago

HosameldinMohamed commented 11 months ago

If I put in the YAML file the following lines:

assignedMasses:
  l_upper_arm : 1.8703
  r_upper_arm : 1.8703

Then:

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

And the values of l_upper_arm and r_upper_arm originally in the XML file are 1.6756 and 1.67729, respectively.

The result in the URDF file is:

l_upper_arm: 1.67729 r_upper_arm: 1.8703

So it seems that the value of l_upper_arm got the original mass of r_upper_arm in the XML file.

Is that a desired behavior to mirror also the mass? If yes, then maybe it's better to mirror the new value in assignedMasses.

traversaro commented 11 months ago

I tried to provide the quickest possible solution in https://github.com/robotology/simmechanics-to-urdf/pull/59, but I did not checked even if the code runs. @HosameldinMohamed can you run the code and check if it works? Thanks!