Batch processing Inverse Dynamics through Matlab
Posted: Sat Jun 27, 2020 8:40 am
Dear Forum-Users,
Thanks for the help you provide us here
We encouter quite some big problems batch processing Inverse Dynamics with Matlab. I'll try to explain what we are doing and also attach an example file for inverse dynamic setup and grf xml + Matlab command window output + the scaled model.
If we use the Inverse Dynamics Tool in the GUI we get quick okay results but we are getting the same output in the message window as in Matlab. FYI: we have a force plate type 3 and converted it to FP type 2 (regarding forces) and calculated the COP. We checked it and it turned out that the transformed data is correct.
If we now use our Matlab script, which i also attached (there are variables passed to that script, but at least you can see, which parameters we assign), we are getting different results than using OpenSim itself.
Two things are a little bit weird: the command window says, that it encounters an old version storage/motion file. What does that mean? And secondly, in the GRF.xml file, there is a line <data_source_name> and <datafile>. In our script we were only able to assign <datafile>(supposedly a .sto file, but we assigned a .mot file) dynamically and were not able to assign <data_source_name>. But as i read it in the .xml file description, it says that <datafile> will always overwrite <data_source_name> if it is available. I am being a litte clueless about all that.
If it is important, i also attached the datastructure in which our data is arranged. Dummy setup files with the correct weighting etc. are laying in the "Data_sorted" top folder. The adjusted setup files for scaling, IK and ID are laying within each subject folder (Subject_01/ScaleSetup, Subject_01/IKSetup,....)
One more side note: What we also see, is that we have moments even when the runner is in the air, but at TD the moment (i.e. knee flexion moment) is zero and shows a plausible curve (compared to inverse kinetic calculations with another program). Does that make any sense?
I hope you can help us with that.
Best regards
/Markus
Thanks for the help you provide us here
We encouter quite some big problems batch processing Inverse Dynamics with Matlab. I'll try to explain what we are doing and also attach an example file for inverse dynamic setup and grf xml + Matlab command window output + the scaled model.
If we use the Inverse Dynamics Tool in the GUI we get quick okay results but we are getting the same output in the message window as in Matlab. FYI: we have a force plate type 3 and converted it to FP type 2 (regarding forces) and calculated the COP. We checked it and it turned out that the transformed data is correct.
If we now use our Matlab script, which i also attached (there are variables passed to that script, but at least you can see, which parameters we assign), we are getting different results than using OpenSim itself.
Two things are a little bit weird: the command window says, that it encounters an old version storage/motion file. What does that mean? And secondly, in the GRF.xml file, there is a line <data_source_name> and <datafile>. In our script we were only able to assign <datafile>(supposedly a .sto file, but we assigned a .mot file) dynamically and were not able to assign <data_source_name>. But as i read it in the .xml file description, it says that <datafile> will always overwrite <data_source_name> if it is available. I am being a litte clueless about all that.
If it is important, i also attached the datastructure in which our data is arranged. Dummy setup files with the correct weighting etc. are laying in the "Data_sorted" top folder. The adjusted setup files for scaling, IK and ID are laying within each subject folder (Subject_01/ScaleSetup, Subject_01/IKSetup,....)
One more side note: What we also see, is that we have moments even when the runner is in the air, but at TD the moment (i.e. knee flexion moment) is zero and shows a plausible curve (compared to inverse kinetic calculations with another program). Does that make any sense?
I hope you can help us with that.
Best regards
/Markus