Page 1 of 1

Loading Motion File to OpenSim 4.0 GUI:

Posted: Thu Nov 22, 2018 7:02 pm
by mlaudu
I use the following snippet of C++ code to save my state variables after an integration/simulation:

Storage statesDegrees(manager.getStateStorage());
osimModel.updSimbodyEngine().convertRadiansToDegrees(statesDegrees);
statesDegrees.print("forward_states.sto");

The resulting file saves the names of each gen coord state variable in the form:

/model_name/jointset/joint_name/gen_coord_name/value

Whenever I try to load such a file into the OpenSim 4.0 GUI I get the error message: "Could not associate motion to current model". I notice that the only way to be able to load the file is to edit it and in the header row remove all occurrences of the '/model_name'. Thus the above entry becomes:

/jointset/joint_name/gen_coord_name/value

Now the file will successfully load as a motion. Is there another way to avoid having to edit the motion file as such? Thanks.
MLA

Re: Loading Motion File to OpenSim 4.0 GUI:

Posted: Thu Nov 22, 2018 8:25 pm
by aymanh
Hi Musa,

I suspect the version of the code you're using for API development is not consistent with the code base for the GUI. At some point we had the model_name as part of the labels, but this was eliminated before the final release. Where did you get the opensim-core code base? If from github, please update and let us know if the issue persists using the latest code on master or 4.0 branch.

Best regards,
Ayman

Re: Loading Motion File to OpenSim 4.0 GUI:

Posted: Fri Nov 23, 2018 5:55 am
by mlaudu
Thanks Ayman. That works. Cheers.
Musa