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

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
vahid F
Posts: 19
Joined: Mon Jul 23, 2018 8:02 am

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

Post by vahid F » Sun Mar 01, 2020 12:03 am

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.

Tags:

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

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

Post by Thomas Uchida » Mon Mar 02, 2020 4:55 am

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');

User avatar
vahid F
Posts: 19
Joined: Mon Jul 23, 2018 8:02 am

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

Post by vahid F » Tue Mar 03, 2020 12:47 am

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.

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

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

Post by Thomas Uchida » Tue Mar 03, 2020 3:38 am

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.

POST REPLY