Inverse Dynamics Does not Output Results
Posted: Thu Aug 31, 2017 7:14 am
Whenever I use the inverse dynamics tool - either from Matlab or OpenSim - I never have any results saved to the output directory. Everything in the IDSetup file and the tool seems correct, so I'm not sure what is going on.
The Folder structure of the data is
\dataset\ -- where the osim & setup files are
\dataset\ID\ -- where ID results are supposed to go
\dataset\IK\ -- where IK results are supposed to go (IK works correctly)
My IDSetup file looks like this (edited for brevity):
My InverseDynamicsTool is set up thusly:
Any help is appreciated. Not sure why this isn't working - it had been. (whether or not there's a file that exists with the output file name, this still happens...)
The Folder structure of the data is
\dataset\ -- where the osim & setup files are
\dataset\ID\ -- where ID results are supposed to go
\dataset\IK\ -- where IK results are supposed to go (IK works correctly)
My IDSetup file looks like this (edited for brevity):
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
<InverseDynamicsTool name="dataSet">
<results_directory>\dataset\ID</results_directory>
<input_directory>./</input_directory>
<model_file>Unassigned</model_file>
<time_range> 0 14.51</time_range>
<forces_to_exclude> Muscles</forces_to_exclude>
<external_loads_file>dataset\dataSet_ExtForSetup.xml</external_loads_file>
<coordinates_file>dataset\IK\data_IKResults_filt.mot</coordinates_file>
<lowpass_cutoff_frequency_for_coordinates>6</lowpass_cutoff_frequency_for_coordinates>
<output_gen_force_file>dataset\ID\data_IDResults.sto</output_gen_force_file>
<joints_to_report_body_forces />
<output_body_forces_file>body_forces_at_joints.sto</output_body_forces_file>
</InverseDynamicsTool>
</OpenSimDocument>
Code: Select all
idSetupFiles = dir('*ExtForSetup.xml');
idExtForces = [pathName idSetupFiles.name];
idOutput = [pathName 'ID\' exrName '_IDResultsMJ.sto'];
idCoords = [pathName 'IK\' strrep(ptOutput, '.mot', '_filt.mot')];
% assign the properties to the inverse dynamics tool
idTool = InverseDynamicsTool([pathName idFile]);
idTool.setStartTime(startTime);
idTool.setEndTime(stopTime);
idTool.setExternalLoadsFileName(idExtForces);
idTool.setOutputGenForceFileName(idOutput);
idTool.setCoordinatesFileName(idCoords);
idTool.setResultsDir([pathName 'ID\'])
% save the modified ID setup file
idTool.print(idFile);
idTool.setModel(currentModel);
idTool.run()
Any help is appreciated. Not sure why this isn't working - it had been. (whether or not there's a file that exists with the output file name, this still happens...)