Loading Motion File to OpenSim 4.0 GUI:
Posted: 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
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