syuntoku14 / fusion2urdf

A Fusion 360 Script to export URDF
MIT License
476 stars 160 forks source link

fix inertia tensor #23

Closed yanshil closed 4 years ago

yanshil commented 4 years ago

The order of the returned value should be (_, xx, yy, zz, xy, yz, xz) = prop.getXYZMomentsOfInertia() as stated in # https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-ce341ee6-4490-11e5-b25b-f8b156d7cd97

but not # xx yy zz xy xz yz

I also removed the round for higher accuracy calculation using VeryHighCalculationAccuracy

syuntoku14 commented 4 years ago

Thank you for the pull request When I test prop.getXYZMomentsOfInertia(), it returns xx yy zz xy xz yz so I thought the official document is wrong. Did you test your code and check whether prop.getXYZMomentsOfInertia() returns (_, xx, yy, zz, xy, yz, xz) or not?

yanshil commented 4 years ago

Aha, I posted in the forum and someone send me your blog link http://syuntoku14.hatenablog.com/entry/2018/09/24/085723

After testing, I think Fusion already fixed this issue.

UIvsOutput 222


P.S. Some other thing that you might already faced with but I am confusing about...

When I was working on the moment of inertia, I am confusing about the what "getPrincipalMomentsOfInertia" do. Do you have any idea of that?

# Get the moments of inertia about the principal axes. Unit for returned values is kg/cm^2. (retVal,i1,i2,i3) = physicalProperties.getPrincipalMomentsOfInertia()

I posted it detailed here https://forums.autodesk.com/t5/fusion-360-api-and-scripts/what-do-exactly-getprincipalmomentsofinertia-gives/m-p/9188152

And someone point me to your blog stating that xy,yz,xz problem

syuntoku14 commented 4 years ago

Thank you for testing it. I merge the pull request.

As for the getPrincipalMomentOfInertia, sorry but I don't have any ideas about it.