-
Notifications
You must be signed in to change notification settings - Fork 311
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
Add calc
methods and Output
s for whole-body momentum to Model
#3487
Changes from 2 commits
1a9e777
11f0207
c88b222
00287ca
92753bc
ca880af
2a9d509
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2222,6 +2222,29 @@ SimTK::Vec3 Model::calcMassCenterAcceleration(const SimTK::State &s) const | |||||
getMultibodySystem().realize(s, Stage::Acceleration); | ||||||
return getMatterSubsystem().calcSystemMassCenterAccelerationInGround(s); | ||||||
} | ||||||
/** | ||||||
* Return the spatial momentum about the system mass center expressed in Ground. | ||||||
* | ||||||
*/ | ||||||
SimTK::SpatialVec Model::calcMomentum(const SimTK::State &s) const | ||||||
{ | ||||||
return getMatterSubsystem().calcSystemCentralMomentum(s); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the examples above (e.g., getMultibodySystem().realize(s, Stage::Velocity); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I think the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it was weird these calls were inside the calc-COM methods, but I think you're right, the |
||||||
} | ||||||
/** | ||||||
* Return the angular momentum about the system mass center expressed in Ground. | ||||||
* | ||||||
*/ | ||||||
SimTK::Vec3 Model::calcAngularMomentum(const SimTK::State& s) const { | ||||||
return getMatterSubsystem().calcSystemCentralMomentum(s).get(0); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mostly a style suggestion, but may make future maintenance simpler. (and same for
Suggested change
|
||||||
} | ||||||
/** | ||||||
* Return the linear momentum expressed in Ground. | ||||||
* | ||||||
*/ | ||||||
SimTK::Vec3 Model::calcLinearMomentum(const SimTK::State& s) const { | ||||||
return getMatterSubsystem().calcSystemCentralMomentum(s).get(1); | ||||||
} | ||||||
|
||||||
|
||||||
/** | ||||||
* Construct outputs | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These Doxygen-style comments don't get picked up from the .cpp file (only the headers). See, for example, the (blank) documentation for
Model::calcMassCenterPosition()
(notably, the potentially useful comment "Return the position vector of the system mass center, measured from the Ground origin, and expressed in Ground." does not appear). Perhaps at least put the Doxygen comments for your new methods in the header file, and create an Issue to move the others.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I can move all these over.