Loading Motion File to OpenSim 4.0 GUI:

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

Loading Motion File to OpenSim 4.0 GUI:

Post by Musa Audu » Thu Nov 22, 2018 7:02 pm

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

Tags:

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Loading Motion File to OpenSim 4.0 GUI:

Post by Ayman Habib » Thu Nov 22, 2018 8:25 pm

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

User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

Re: Loading Motion File to OpenSim 4.0 GUI:

Post by Musa Audu » Fri Nov 23, 2018 5:55 am

Thanks Ayman. That works. Cheers.
Musa

POST REPLY