Page 1 of 1

fixing the motion file of the older version for use in OpenSim 4.0

Posted: Sun Mar 01, 2020 12:03 am
by vahid34
Hi.
I want to use my models and motion data of version 3.3 to run CMC in the OpenSim 4.0. According to the upgrade note for OpenSim 4.0, I first changed the knee_angle_beta in the .osim file to be coupled coordinate. Now I want to update motion files using "updatePre40KinematicsFilesFor40MotionType()" function. But how must we use this function? what's its input?
I used this function in the scripting shell and Matlab, but I encountered several errors such as this function not defined.

Thanks.

Re: fixing the motion file of the older version for use in OpenSim 4.0

Posted: Mon Mar 02, 2020 4:55 am
by tkuchida
Now I want to update motion files using "updatePre40KinematicsFilesFor40MotionType()" function. But how must we use this function? what's its input?
Please see the doxygen documentation here: https://simtk.org/api_docs/opensim/api_ ... d37b2810f3. In Matlab, the code would look something like this:

Code: Select all

import org.opensim.modeling.*;
myModel = Model('filename.osim');
updatePre40KinematicsFilesFor40MotionType(myModel, 'kinematics.mot');

Re: fixing the motion file of the older version for use in OpenSim 4.0

Posted: Tue Mar 03, 2020 12:47 am
by vahid34
Tanks for your response.
I ran the Matlab code suggested by you but the Matlab got an error.
"Undefined function or variable 'updatePre40KinematicsFilesFor40MotionType'."

I visited the link you shared but on this page have been written that this function Not available through scripting.

Re: fixing the motion file of the older version for use in OpenSim 4.0

Posted: Tue Mar 03, 2020 3:38 am
by tkuchida
According to the "Upgrade Notes for OpenSim 4.0" page in the documentation (https://simtk-confluence.stanford.edu/d ... penSim+4.0): "Use the function updatePre40KinematicsFilesFor40MotionType() to fix older MOT files which would have incorrectly converted the units of some coordinates. This function is available in the GUI Scripting Shell, Python, Matlab, and C++." Unfortunately, I'm unable to test on Matlab so perhaps the method isn't in fact available there---however, it's available in Python.