opensim-org / opensim-moco

Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.
https://opensim.stanford.edu/moco
Apache License 2.0
58 stars 16 forks source link

MocoAverageSpeedGoal unrecognized when reading MocoStudy from xml #662

Closed SolaWeng closed 3 years ago

SolaWeng commented 3 years ago

The MocoAverageSpeedGoal seems to be unrecognized when reading a saved MocoStudy xml file.

I am using MATLAB 2020b with OpenSim Moco 0.4.0 on windows 10. I used the example2DWalking with additional lines at the end:

study.print("study.xml"); MocoStudy("study.xml");

Error message: Encountered unrecognized Object typename MocoAverageSpeedGoal while reading property goals. There is no registered Object of this type; ignoring.

Feels like this is a bug. Just to want to bring this to your attention.

antoinefalisse commented 3 years ago

Thanks @SolaWeng for reporting this issue. Moco has now been merged in OpenSim, and this bug has been corrected, see here. If this bug is blocking you for making further progress, you can remove the MocoAverageSpeedGoal from the .xml file, create your study MocoStudy("study.xml");, and add the goal back programmatically.

SolaWeng commented 3 years ago

Hi Antoine,

Thanks for the update! For now I can just redefine the MocoAverageSpeedGoal in MATLAB. It's not a big issue.

Cheers, Sola