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

leg6dof9musc replay of IK solution has disconnected patella #617

Closed
aseth1 opened this issue Mar 23, 2018 · 5 comments
Closed

leg6dof9musc replay of IK solution has disconnected patella #617

aseth1 opened this issue Mar 23, 2018 · 5 comments

Comments

@aseth1
Copy link
Member

aseth1 commented Mar 23, 2018

Steps to reproduce

  • load leg6dof9musc.osim model from Models with distribution.
  • load the Swing/leg69_IK_swing.mot motion file
  • press play.

Expected result

Swing motion plays and all patella is constrained to the knee.

Actual result

Overall leg motion is correct but the patella does not track the femur.
screen shot 2018-03-22 at 9 45 27 pm

This seems to be a constraint enforcement issue, because when a coordinate slider is manually adjusted, the patella snaps back into place.

This is likely related to #608 since the vectorized setting of state values does not enforce constraints. It expects that state values were obtained by satisfying constraints. Although IK computes the constrained knee_angle_pat_r value (constrained to be the knee_angle), it does not report the constrained coordinate value, and Model::formStateStorage will use its default value.

The fix here is to add a final Model::assemble(s) for good measure OR detect when the input files are motions (e.g. does not have a complete state) and then do the assemble.

Environment and GUI version

Windows build 0321

@aymanhab
Copy link
Member

Thanks for the find @aseth1 Can you advise as to where to assemble()? e.g. right after calling setStateVariableValues? Should we do this only if there are constraints in the model, for efficiency? Also wouldn't that break #540 again if we assemble since constraints will be enforced? Thanks

@aseth1
Copy link
Member Author

aseth1 commented Mar 23, 2018

Model::assemble() will only assemble if there are constraints. For #540 the fix was to move clamping within the enforce constraints check, so the assemble should not push the values within the bound. What did you observe in #620?

@aymanhab
Copy link
Member

Fixed by PR #620, Please verify and close as needed.

@jenhicks jenhicks added this to the OpenSim 4.0 milestone Mar 26, 2018
@jenhicks
Copy link
Member

This is fixed on my Mac (3-26 build)

@jimmyDunne
Copy link
Member

Fixed on W10.

Build 04-27-18

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

No branches or pull requests

4 participants