The patella constraints make IK super slow; by removing them we can get some massive speed up. Since the patella should not be defining the IK solution at all (no markers attached to the patella), it should be fine to create a temporary model without the patella bodies, the patellofemoral joints, and the patella constraints and then run IK with that model. This is what this PR is implementing. Note that there are muscles attached to the patella, I therefore also removed all muscles (no involved in IK):
I did a fair bit of testing:
60s trial (60 Hz) ~ 3600 frames
With constraints: IK time - 218s
Without constraints: IK time - 7s
running trial 1242 frames
With constraints: IK time - 64s
Without constraints: IK time - 8s
When I compare the resulting IK results, the angles are within 1deg. You can run the compare.py script in the attached folder to appreciate the differences for running. Interesting fact 1: the largest differences are for the pro_sup angles. Intersting fact 2: with constraints the mtp angle is set to 7.5deg, without constraints tht mtp angle is set to 0deg. There are no markers attached to the mtp, so 0deg seems more expected. The side benefit of this PR is that we no longer get this knee_angle_beta columns in the mot file, so we no longer see it in the dashboard.
@suhlrich @carmichaelong
The patella constraints make IK super slow; by removing them we can get some massive speed up. Since the patella should not be defining the IK solution at all (no markers attached to the patella), it should be fine to create a temporary model without the patella bodies, the patellofemoral joints, and the patella constraints and then run IK with that model. This is what this PR is implementing. Note that there are muscles attached to the patella, I therefore also removed all muscles (no involved in IK):
I did a fair bit of testing:
When I compare the resulting IK results, the angles are within 1deg. You can run the
compare.py
script in the attached folder to appreciate the differences for running. Interesting fact 1: the largest differences are for the pro_sup angles. Intersting fact 2: with constraints the mtp angle is set to 7.5deg, without constraints tht mtp angle is set to 0deg. There are no markers attached to the mtp, so 0deg seems more expected. The side benefit of this PR is that we no longer get this knee_angle_beta columns in the mot file, so we no longer see it in the dashboard.test.zip