keenon / AddBiomechanics

A tool to automatically process and share biomechanics data
https://addbiomechanics.org/
Other
26 stars 5 forks source link

engine.py breaks at lowpass_filtering and thus skipping DynamicFitter #234

Closed TheOne-1 closed 5 months ago

TheOne-1 commented 5 months ago

For the AddB dataset, we removed joint angle constraints to avoid incontinuous joint angles (e.g., jumping from -pi to pi). However, this lowpass filtering script code requires joint angle ranges to be within joint limits. As a result, DynamicFitting was not performed.

Search "Skipping dynamics fit of segment starting" in the attached log for details. log.txt

nickbianco commented 5 months ago

Thanks for raising this @TheOne-1. Could you clarify one thing: so instead of jumping from -pi to pi, the joint angle can go from -pi to -2pi and beyond?

TheOne-1 commented 5 months ago

Yes Keenon suggested allowing +-2pi and beyond angles to avoid discontinuity before filtering. Correct me if I'm wrong @keenon.

Accordingly, I modified osim model limits to -10pi ~ 10pi.

nickbianco commented 5 months ago

And that fixed your problem? Or do we need to add a fix here?

TheOne-1 commented 5 months ago

After digging more it looks like the issue has nothing to do with joint limits in osim model.

In theory this function should take care of joint angle wrapping, but it failed and caught by this line. Maybe I should raise it in the Nimble repo.

nickbianco commented 5 months ago

If you're able to reproduce the bug in an issue on nimblephysics, that would be great! (Feel free to close this issue if it is no longer needed).