Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Isabelle Siegler
Posts: 2
Joined: Fri Oct 23, 2015 2:15 am

Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Isabelle Siegler » Wed Dec 30, 2020 4:05 am

Hello,

I cannot succeed in using the c3dExport.m script also it seems that I've followed the complete installation process of matlab librairies. I've checked the PATH in the windows environment variables and checked in Mtalab with the command: org.opensim.modeling.opensimCommon.GetVersion()
I have also checked the matlab path and I have the Matlab\utilities directory in it.

The error message I get is the following:

Error using osimC3D/getRate_force (line 100)
Java exception occurred:
java.lang.RuntimeException: Key 'DataRate' not found.
Thrown at ValueArrayDictionary.h:148 in getValueAsString().

at org.opensim.modeling.opensimCommonJNI.AbstractDataTable_getTableMetaDataAsString(Native Method)

at org.opensim.modeling.AbstractDataTable.getTableMetaDataAsString(AbstractDataTable.java:55)

Error in c3dExport (line 45)
rForces = c3d.geotRate_frce();


I tried initially with the Matlab 2019b version, and I have just installed the 2020b version to see if it works better. It's not the case.
What can I do to solve this problem?
Thanks in advance,

Isabelle

Tags:

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

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Thomas Uchida » Wed Dec 30, 2020 9:58 am

The message "Key 'DataRate' not found" suggests that "DataRate" is missing from the input file. If you have never used the script before, you could try running it using a file that is known to work (to rule out installation/path/other issues). Then, perhaps check that your TRC file conforms to the format described on the "Marker (.trc) Files" page in the documentation: https://simtk-confluence.stanford.edu/d ... c%29+Files.

User avatar
Isabelle Siegler
Posts: 2
Joined: Fri Oct 23, 2015 2:15 am

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Isabelle Siegler » Thu Dec 31, 2020 12:07 am

Thank you for your quick answer. Thanks to your answer, I found that the problem came from the fact that I do not have force date in my c3d files. I think I suceed in modifying the scripts so that forces are not looked for by the scripts and functions.

User avatar
Sebastian Neuberg
Posts: 15
Joined: Mon Mar 08, 2021 3:21 pm

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Sebastian Neuberg » Mon May 31, 2021 3:28 pm

Hello,

I've exact the same issue.
I try to convert a c3d file from a public motion database: https://motion-database.humanoids.kit.e ... listpage=1
I've attached a file which I tried, but that issue occured on several files.

I'm using OpenSim 4.2 and Matlab R2021a with c3dExport.m script.

Where can I find c3d files which is known to work, for testing purpose?

And how can I determine if the c3d file lacks of force data? I've loaded the c3d file with Mokka but I'm not familiar enough with that tool at all. Isabelle can you share how you have solved your issue?

Best regards,
Sebastian
Attachments
files_motions_1758_lift box from left to right side.zip
(549.03 KiB) Downloaded 29 times
Last edited by Sebastian Neuberg on Tue Jun 01, 2021 3:07 pm, edited 1 time in total.

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

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Ayman Habib » Tue Jun 01, 2021 10:41 am

Hi Sebastian,

Our github repository has example .c3d files that we test against here
https://github.com/opensim-org/opensim- ... sts/shared

Please let us know if these work for you. Will pass your question regarding how to check for the availability of Force data by the ezc3d developer(s).

Best regards,
-Ayman

User avatar
Sebastian Neuberg
Posts: 15
Joined: Mon Mar 08, 2021 3:21 pm

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Sebastian Neuberg » Tue Jun 01, 2021 3:57 pm

Dear Ayman,

I ran the c3dExport.m script with walking2.c3d and walking5.c3d from the mentioned repository. Both worked well without any interruption. I noticed from the generated mot-files, that they contain ground reactions.
I think with this test it is verified that the script works as intended.

Unfortunately that doesn't solve my issue yet.
Today I've tried additionally to convert several motion data in c3d format from
CMU Graphics Lab Motion Capture Database: http://mocap.cs.cmu.edu
KIT Whole-Body Human Motion: https://motion-database.humanoids.kit.edu
using the c3dExport.m script and got "Error using osimC3D/getRate_force (line 100) [...] Key 'DataRate' not found." every time. Both databases describes that a Vicon motion capture system was used for capturing.

I would be very happy to find a solution to debug this issue and get a work around or fix.

Best regards,
Sebastian

User avatar
Benjamin Michaud
Posts: 31
Joined: Mon May 03, 2010 6:35 am

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Benjamin Michaud » Wed Jun 02, 2021 2:47 am

Dear all,

As requested by Ayman, I've tried to open the file directly using the C3DFileAdapter using ezc3d and the file is properly loaded. As expected, it creates an empty table for the analogs when none are found, which is similar to the behavior of the previous backend (BTK). Therefore, I do not think this is an issue related to the backend c3d reader.

I could not find the "c3dExport.m" file, but I suspect this script (or a function that this script calls) was not expecting a file without data in the analog. If you need, I can change the default behavior of the C3DFileAdapter when no analogs are found (for instance providing a value for the rateForce), but I would suggest against such a modification...

I am not sure if I can help more, let me know if I can!

Cheers

User avatar
Sebastian Neuberg
Posts: 15
Joined: Mon Mar 08, 2021 3:21 pm

Re: Troubles with Matlab (2019b or 2020b) Scripting Environment - Java error

Post by Sebastian Neuberg » Thu Jun 17, 2021 2:38 am

Dear Benjamin,

Thanks for your answer and please excuse my late reply.

I'm not aware if I understand your answer completely. Maybe this is because I've never used a motion capturing system by myself.
As I understand you, the issue is related to the data I'm using and does not belong to the ezc3d algorithm.
Maybe the issue is that I have a wrong expectation how the process of collection, converting and importing the data in OpenSim works.
From my limited understanding the motion capturing system records a video of a human being equipped with markers. The motion capturing software computes the pictures and stores marker positions and there references coordinates frame by frame. These information are stored in the c3d file. Additionally analog data of force plates etc. can be stored to the same c3d file. I'll hope I'm right until this.
When I'm using the ezc3d library and the Matlab scripts the c3d data is read and the marker positions should be transferred to the .trc file and the movement of the coordinates should be converted the .mot file.
I assume anywhere in this process I'm missing something.

I just try to research an application in OpenSim for my student project, I'm not an advanced programmer.
I'm still not aware what requirements a c3d file must fulfil to convert them with ezc3d for usage as motion in OpenSim and how I can check if a c3d file comply to the requirements. I've read and try to understand the How to use section of ezc3d readme as well as the User Guide on c3d.org. To be honest I haven't understand everything I've read there.

Additional I tried to convert the example data from c3d.org using the "c3dExport.m" script. In most cases I got the "java.lang.RuntimeException: Key 'DataRate' not found." error message.
For the file "Sample00\Codamotion\codamotion_gaitwands_20150204.c3d" the script works well, but the .mot file contains only ground reactions instead of motion data.

Regarding the Matlab script I mentioned please find more details below:
The "c3dExport.m" file is a script provided by the developers of OpenSim, it can be found on Github repo here.. It is related to the topic Preparing Your Data - C3D (.c3d) Files of the OpenSim documentation. The "c3dExport.m" calls functions from the "osimC3D.m" (can be found on Githu repo here), which in turn seems to call the c3dAdapter.

Hope you can help me to understand how to transfer the motion capturing data correctly.

Best regards,
Sebastian

POST REPLY