Hello!
I'm switching my model building workflow from [CAD software -> NMSBuilder -> Matlab post-processing] to [CAD software -> Matlab model construction] (thus omitting NMSBuilder completely, perhaps with a visual landmarking solution as an in-between step). For now, I'm trying to recreate models that I've built using NMSBuilder's visual interface through scripting alone. I've got two questions about the model building process.
1) The mass moment of inertia tensor can be written out as:
(I plucked this from wikipedia). Specifically, the product moments here are positive (eg Ixy = m*x*y), and when placed in the tensor, are given a negative sign. I have also seen notations where the product moments themselves are defined as negative (eg Ixy = -m*x*y), and then product moments don't receive a negative sign in the tensor. I cross-checked NMSBuilder's outputs with my CAD's (volume) moment of inertia outputs, and it seems that the product moments are defined as positive in my model. Is this the correct way to use body.setInertia()?
In other words, if I call body.setInertia(Ixx,Iyy,Izz,Ixy,Ixz,Iyz), do the calculations under the hood use a corresponding Inertia tensor of the form
[Ixx -Ixy -Ixz]
[-Ixy Iyy -Iyz]
[-Ixz -Iyz Izz]
I checked the simbody theory manual, but I couldn't find it stated explicitly there.
2) NMSBuilder seems to ignore the use of frames. Eg: in a two body model, body one has its CoM at [0,0,0] in the global frame, and body two at [1,0,0] in the global frame. A model built using NMSBuilder, will omit defining the body-affixed frames, which I think means they all default to [0,0,0]. Then, when defining the CoM position, it will be defined with respect to the global reference frame (eg. [1,0,0], instead of the body-affixed frame (where it would logically be [0,0,0]. Am I correct in assuming that the mechanics will be computed identically?
The other option would be to define body affixed frames aligned to the body CoMs (and then COM location would be [0,0,0] in the body frame), and where the frame orientation is aligned to the principal directions of the body inertia tensor (leading to the product moments being zero). Since this would lead to many different frame orientations in my case, I think I prefer everything aligned to global (with the use of product moments to compensate), unless there is a compelling reason not to do so.
Thanks!
Pasha
setInertia() & frames question
- Pasha van Bijlert
- Posts: 228
- Joined: Sun May 10, 2020 3:15 am