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
Loading Motion File to OpenSim 4.0 GUI:
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Loading Motion File to OpenSim 4.0 GUI:
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
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:
Thanks Ayman. That works. Cheers.
Musa
Musa