opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

indicating inDegrees in .sto or save to .mot using equivalent of STOFileAdapter

Open cvhammond opened this issue 3 years ago • 4 comments

Is there a way to save to .mot similar to the STOFileAdapter? The issue I'm having is I'm taking data in degrees in an .mot, parsing, chopping, reducing the data and then I want to save it to .mot again, or potentially a .sto, but those files expect joint angles in radians. Is there a way to indicate inDegrees in a .sto file or save to .mot with inDegrees=true?

cvhammond avatar Jul 11 '22 15:07 cvhammond

The .mot files are primarily there for legacy, I'd stick with .sto files. The STOFileAdapter writes a timeseries table which contains meta-data that could account for the inDegrees selection, we also have utilities e.g. SimbodyEngine::convertRadiansToDegrees that provide convenience methods to do this conversion. If that works please let us know where to improve documentation to make this clear, otherwise let us know if you run into issues.

aymanhab avatar Jul 11 '22 16:07 aymanhab

I didn't realize .mot files were legacy. I think I will just write a function to check the .mot for inDegrees upon first import.

With that being said, should the IK tool in the GUI be exporting to a .sto file in radians rather than the current .mot procedure?

cvhammond avatar Jul 11 '22 17:07 cvhammond

I wouldn't want to imply that mot file format is on the way out, I'd just say that newer code is more oriented towards sto files which support versioning so will continue to be built-upon while the .mot file format originated in SIMM world so it's stuck in the past. The tools remained the same since version 1.0 so will not change until a major overhaul is needed.

aymanhab avatar Jul 11 '22 17:07 aymanhab

I think we have something of a solution on our end. Thank you for your help.

cvhammond avatar Jul 11 '22 21:07 cvhammond