Whole Body Angular Momentum?
- Pawel Golyski
- Posts: 2
- Joined: Tue Jun 06, 2017 7:47 am
Whole Body Angular Momentum?
I am using a full body opensim model (Hamner 2010) and am hoping to calculate whole body angular momentum with respect to the center of mass of the whole body. I see I can get segment positions, velocities, orientations, and angular velocities from the Body Kinematics tool, but I want to make sure I am understanding the coordinate systems correctly.
Right now, I have "express_results_in_body_local_frame" unchecked in the Body Kinematics, so my translations and linear velocities of my individual segment centers of mass and the whole body center of mass are relative to the lab coordinate frame, which is great.
However, I would like to calculate the product of the moment of inertia of each body segment with its angular velocity and express that in the global coordinate frame. Is the moment of inertia of each segment given by Opensim expressed relative to the center of mass of each segment, while the angular velocity is expressed relative to the origin of the segment?
Right now, I have "express_results_in_body_local_frame" unchecked in the Body Kinematics, so my translations and linear velocities of my individual segment centers of mass and the whole body center of mass are relative to the lab coordinate frame, which is great.
However, I would like to calculate the product of the moment of inertia of each body segment with its angular velocity and express that in the global coordinate frame. Is the moment of inertia of each segment given by Opensim expressed relative to the center of mass of each segment, while the angular velocity is expressed relative to the origin of the segment?
Tags:
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Whole Body Angular Momentum?
The moment of inertia for bodies in OpenSim are defined as about the body's center of mass. For angular velocity, if "express_results_in_body_local_frame" is unchecked, then the angular velocity of the body is given with respect to the lab (ground) frame.
- Pawel Golyski
- Posts: 2
- Joined: Tue Jun 06, 2017 7:47 am
Re: Whole Body Angular Momentum?
Thank you! So this is the case even though the .sto file generated by Body Kinematics says: "Angular velocities and accelerations are given about the body-local axes." ?
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Whole Body Angular Momentum?
Ah, thanks for pointing that out. That header does not seem to update correctly. I'll look into this issue, but I think this issue only affects the header text and not the results.
The code for calculating the angular velocity is given here: https://github.com/opensim-org/opensim- ... s.cpp#L502
To be precise here, this is what the calculations seem to be doing:
1. Angular velocity is always the angular velocity of the body with respect to the ground frame.
2a. If "express_results_in_body_local_frame" is checked, then the angular velocity is re-expressed in the body's frame.
2b. If "express_results_in_body_local_frame" is not checked, then the angular velocity is expressed in the ground frame.
The code for calculating the angular velocity is given here: https://github.com/opensim-org/opensim- ... s.cpp#L502
To be precise here, this is what the calculations seem to be doing:
1. Angular velocity is always the angular velocity of the body with respect to the ground frame.
2a. If "express_results_in_body_local_frame" is checked, then the angular velocity is re-expressed in the body's frame.
2b. If "express_results_in_body_local_frame" is not checked, then the angular velocity is expressed in the ground frame.
- Shabnam Sh
- Posts: 2
- Joined: Mon Nov 18, 2019 8:24 pm
Re: Whole Body Angular Momentum?
Hi,
I am trying to the same. I got each segments inertia from the .osim file which apparently it's with respect to the segement's com. Do you know how can I get it with respect to whole body cenetr of mass? or in the global frame?
I really appreciate your help.
Thanks!
Shabnam
I am trying to the same. I got each segments inertia from the .osim file which apparently it's with respect to the segement's com. Do you know how can I get it with respect to whole body cenetr of mass? or in the global frame?
I really appreciate your help.
Thanks!
Shabnam
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: Whole Body Angular Momentum?
Hello Shabnam,
Do you want the whole body angular momentum expressed in the ground frame? As there are API methods to do this for you search for 'calcBodyMomentum' and you should see a few options!
If you want to calculate a body's inertia about a different point and in a different frame you can use the methods for a body's MassProperties: https://simtk.org/api_docs/molmodel/api ... ies__.html - see for example calcShiftedInertia... although now I look more I think this method would be cleaner: https://simtk.org/api_docs/molmodel/api ... eb1142b661
Thanks,
Nicos
Do you want the whole body angular momentum expressed in the ground frame? As there are API methods to do this for you search for 'calcBodyMomentum' and you should see a few options!
If you want to calculate a body's inertia about a different point and in a different frame you can use the methods for a body's MassProperties: https://simtk.org/api_docs/molmodel/api ... ies__.html - see for example calcShiftedInertia... although now I look more I think this method would be cleaner: https://simtk.org/api_docs/molmodel/api ... eb1142b661
Thanks,
Nicos
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
Re: Whole Body Angular Momentum?
Hi, whole body momentum (angular and linear) of a full-body model can be calculated directly via SimTK::SimbodyMatterSubsystem::calcSystemCentralMomentum:
Code: Select all
state = model.initSystem()
matter = model.getMatterSubsystem()
model.realizeVelocity(state)
momentum = matter.calcSystemCentralMomentum(state)
angularMomentum = momentum.get(0)
linearMomentum = momentum.get(1)
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
Re: Whole Body Angular Momentum?
Since version 4.4.1, it's been exposed under Model class:
Code: Select all
model.calcAngularMomentum(state)
- Shabnam Sh
- Posts: 2
- Joined: Mon Nov 18, 2019 8:24 pm
Re: Whole Body Angular Momentum?
Hi Nicos,
I got the inertial tensor directly from the model osim file. I was wondering if the inertial tensor is in the lab frame or the body's local frame.
Thanks,
Shabnam
I got the inertial tensor directly from the model osim file. I was wondering if the inertial tensor is in the lab frame or the body's local frame.
Thanks,
Shabnam
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: Whole Body Angular Momentum?
Hey Shabnam,
I believe they are expressed about a given body's center of mass and in the frame of the body. The model you are using potentially describes this information in an associated publication more than likely!
Hope that helps!
Nicos
I believe they are expressed about a given body's center of mass and in the frame of the body. The model you are using potentially describes this information in an associated publication more than likely!
Hope that helps!
Nicos