-
Notifications
You must be signed in to change notification settings - Fork 49
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
More asserts in URDF write.jl #520
Comments
To summarize as a simple runnable example: using RigidBodyDynamics
using StaticArrays
moment = [12.48 -0.007 0.458; -0.007 88.133 0.0003354; 0.458 0.0003354 78.551]
com = [0.0, 0.0, 1.4608]
m = 159.923
frame1 = CartesianFrame3D()
frame2 = CartesianFrame3D()
inertia1 = SpatialInertia(frame1, moment, com * m, m)
tf = Transform3D(inertia1.frame, frame2, @SVector [-0.0, -0.0, -1.4608])
inertia2 = transform(inertia1, tf)
@show inertia2 results in SpatialInertia expressed in "anonymous":
mass: 159.923
center of mass: Point3D in "anonymous": [0.0, 0.0, 0.0]
moment of inertia:
[-328.786 -0.007 0.458; -0.007 -253.133 0.0003354; 0.458 0.0003354 78.551] This is because julia> using LinearAlgebra
julia> eigvals(SMatrix(inertia1))
6-element SArray{Tuple{6},Float64,1,6}:
-158.77064513722854
-112.32906311867893
78.55128470628988
159.923
331.17335978337456
360.385063766243 What's happening is that You probably assumed that the moment of inertia is expressed in a frame with the center of mass as the origin. This is not the case; everything is expressed in There's been at least one other person who has been confused about this though; I really should stress this point more in the documentation and add a convenience constructor that allows you to specify the moment of inertia about the center of mass. |
I'm extremely grateful for your careful and detailed responses. The fact that the inertia terms for only three of my six links were wrong is rather embarrassing as those were the three for which I attempted to re-calculate the values following a misunderstanding between the drawing office and me in defining the components in their CAD models, from which the original inertia tensors were produced. (Ouch!) |
Working perfectly now! 🥇 |
Good to hear! |
Wow, very cool! |
As requested by @tkoolen here is a sort of minimal working example:
I construct a one-body, one-joint "robot". The revolute (z-axis) joint "A3" connects between "world" and a rigid body called "a3_a3b". What I would like is for (perhaps) URDF write.jl to emit an informative error to help users easily figure out where they've gone wrong. E.g.:
Set up: This is "my" inertia before it gets loaded into RBD
The above is correct.
Not quite sure why edge and vertex (above) are the same, especially when they are different below. From now on I type from line 18 of write.jl into the REPL.
The above makes perfect sense.
Correct.
Starting to look odd: -ve translation? Is "annonymous" the inertial FoR? Not "world"?
The above is wrong. (Note I used a new variable name "inert" to preserve the "iner" variable.)
Correct
Incorrect.
I believe that this is a brain issue (mine, e.g. not knowing how to use RBD) not a coding error on anyone's part. But some additional @asserts scattered throughout the process would be extremely useful!
The text was updated successfully, but these errors were encountered: