robotology / sdf-modelica

URDF/SDF to to Modelica model converter.
GNU Lesser General Public License v3.0
14 stars 6 forks source link

Inertia matrix seems wrong #9

Open triccyx opened 6 years ago

triccyx commented 6 years ago

Not easy to understand but at least it seems to have too much null cells. Is it a precision problem?

triccyx commented 6 years ago

Also if the CM of .urdf file is the same as the one in .mo file, inertia martix should be the same in both case

traversaro commented 6 years ago

@triccyx Can you check with the example provided in the readme: https://github.com/robotology-playground/sdf-modelica#example-usage ? In that case, the inertia values of 0.01 seem to be correctly converted from urdf to Modelica.

triccyx commented 6 years ago

URDF <inertia ixx="5.1392929e-06" ixy="4.4959551e-07" ixz="-2.2106268e-06" iyy="1.0381641e-05" iyz="3.5075043e-07" izz="9.5451504e-06"/>

MODELICA TRANSLATED I_11 = 0.000005, I_22 = 0.000010, I_33 = 0.000010, I_21 = 0.000000, I_32 = 0.000000, I_31 = -0.000002)

It is for sure a precision issue look at ixy and I_21

But I don't know if this is relevant to my problems

On Fri, 8 Jun 2018 at 18:06, Silvio Traversaro notifications@github.com wrote:

@triccyx https://github.com/triccyx Can you check with the example provided in the readme: https://github.com/robotology-playground/sdf-modelica#example-usage ? In that case, the inertia values of 0.01 seem to be correctly converted from urdf to Modelica.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robotology-playground/sdf-modelica/issues/9#issuecomment-395808354, or mute the thread https://github.com/notifications/unsubscribe-auth/AIsv-2MczdQaPSmGr2bMuvs_a06chgzOks5t6qCRgaJpZM4Ugiz_ .

-- www.thetreasuremaps.com

traversaro commented 6 years ago

Good catch. I think the problem is in numbers expressed with the scientific notation, however the error is minimal, so if you had strange results I do not think this is the problem. I will be working on it.

triccyx commented 6 years ago

Same problem in CM vector position from frame_a in Modelica.Mechanics.MultiBody.Parts.Body

traversaro commented 3 years ago

Removing my assignment, if anyone wants to work feel free to do so.