Skip to content
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

Improvements to MocoUtilities::createExternalLoadsTableForGait() #3918

Merged
merged 9 commits into from
Oct 4, 2024

Conversation

nickbianco
Copy link
Member

@nickbianco nickbianco commented Sep 27, 2024

Fixes issues #3763, #3909

Brief summary of changes

Add the two following improvements to MocoUtilities::createExternalLoadsTableForGait():

  1. When vertical force is zero, centers of pressure are set to zero, rather than be computed as NaN.
  2. The utility now returns vertical torque instead of the sum of sphere torques. Now, the forces, torques, and COPs should all be consistent with each other.

Testing I've completed

Added a test to testMocoContact to check that the new representation of GRFs produces the same accelerations as the original contact force eleents.

Looking for feedback on...

CHANGELOG.md (choose one)

  • updated.

This change is Reviewable

@nickbianco nickbianco marked this pull request as ready for review September 30, 2024 20:22
@nickbianco nickbianco changed the title [WIP] Improvements to MocoUtilities::createExternalLoadsTableForGait() Improvements to MocoUtilities::createExternalLoadsTableForGait() Sep 30, 2024
Copy link
Member

@carmichaelong carmichaelong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just some minor suggestions for documentation clarity. Feel free to merge after addressing those (if you do).

Reviewed 5 of 7 files at r1.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @nickbianco)


CHANGELOG.md line 27 at r1 (raw file):

  comprehensive overview).
- Made improvements to `MocoUtilities::createExternalLoadsTableForGait()`: center of pressure values are now set to zero, rather 
  than NaN, when vertical force is zero and the vertical torque is returned in the torque columns (rather than the sum of the 

these are two statements, right? i.e.:

  1. center of pressure values ... is zero
  2. the vertical torque ... GRF representation

if i'm interpreting right, could split into two sentences, or just add a comma, e.g. when vertical force is zero, and the vertical torque...


OpenSim/Moco/Test/testMocoContact.cpp line 623 at r1 (raw file):

// This is a round-trip test: we create external loads from a trajectory
// using createExternalLoadsTableForGait(), then use the external loads to
// apply forces to a model, and ensure the accelerations of the model match

consider something like the following to provide an overview of the test at the top (the comment by the last for loop was helpful for this):
... apply forces to a model without contact, and ensure the accelerations match those of the original model.

@nickbianco nickbianco merged commit 4a8707b into main Oct 4, 2024
8 of 11 checks passed
@nickbianco nickbianco deleted the moco_external_loads_for_gait_fix branch October 4, 2024 00:01
@nickbianco
Copy link
Member Author

Thanks @carmichaelong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants