STOFileAdapter.read() not available

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ruth Meißner
Posts: 16
Joined: Sat Mar 23, 2019 11:28 am

STOFileAdapter.read() not available

Post by Ruth Meißner » Mon May 18, 2020 12:09 pm

Hi everybody,
my university updated the student computers which means that I need to switch from OpenSim 4.0 to 4.1. I developed over the last month my own motion capture analysis in OpenSim using the coding possibilities in Matlab.

Prior to the conversion, my code ran without any problems in OpenSim 4.0 which was integrated in Matlab 2018b.
Now, the new computers are equipped with Matlab 2019b and OpenSim 4.1.
And only now I am facing some issues with the exact same code: It throws an error when I want to use STOFileAdapter.read(filepathofmotfile).
Undefined function 'read' for input arguments of type 'org.opensim.modeling.STOFileAdapter'.
Before the update, this code ran fine.

So to check, I used "methodsview(STOFileAdapter)" in both Matlab versions to verify.
Indeed, in Matlab 2018b (integrated with OpenSim 4.0) the function "read" is listed.
In Matlab2019b with OpenSim 4.1 the function "read" is missing, which means that this function obviously cannot be found by Matlab. If I check with the API for STOFileAdapter (https://simtk.org/api_docs/opensim/api_ ... ter__.html) "read" should still be available.

So my question is: Did anyone else face this issue when changing to 4.1?
Has there been an update and am I supposed to use another function to read in a *.mot-file?
Or might this possibly be a bug?

Thank you :)
Best regards,
Ruth

Tags:

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

Re: STOFileAdapter.read() not available

Post by Ayman Habib » Mon May 18, 2020 12:46 pm

Hi Ruth,

Sorry about the confusion. The method 'read' still exists but the signature has changed to be consistent across all Adapters, so instead of using a "custom" read method for each Adapter, they all use the same generic signature that takes a source/filename and returns a list of Tables.

You'll likely not need to use this generic read method altogether but rather construct a table directly from the sto file as described here
https://simtk-confluence.stanford.edu/d ... g+Commands
under the section Reading data files. You'll use TimeSeriesTable, or TimeSeriesTableVec3 depending on the data you have in the file.

Hope this helps,
-Ayman

User avatar
Ruth Meißner
Posts: 16
Joined: Sat Mar 23, 2019 11:28 am

Re: STOFileAdapter.read() not available

Post by Ruth Meißner » Mon May 18, 2020 2:11 pm

Hi Ayman,

thanks for this advice, it worked :)

POST REPLY