Inverse Dynamics Does not Output Results

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Aaron Godfrey
Posts: 55
Joined: Tue Feb 16, 2016 12:34 pm

Inverse Dynamics Does not Output Results

Post by Aaron Godfrey » 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):

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>

My InverseDynamicsTool is set up thusly:

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...)

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Inverse Dynamics Does not Output Results

Post by Christopher Dembia » Thu Aug 31, 2017 8:46 am

Try this:
<results_directory>dataset/ID</results_directory>
I'm not sure it'll help, but "\dataset\ID" might look like an absolute path to the software.

User avatar
Aaron Godfrey
Posts: 55
Joined: Tue Feb 16, 2016 12:34 pm

Re: Inverse Dynamics Does not Output Results

Post by Aaron Godfrey » Thu Aug 31, 2017 8:54 am

Nah, that's not it. It's a full directory listing, I just replaced the path with '\dataset\' for the sake of brevity.

User avatar
Aaron Godfrey
Posts: 55
Joined: Tue Feb 16, 2016 12:34 pm

Re: Inverse Dynamics Does not Output Results

Post by Aaron Godfrey » Fri Sep 01, 2017 3:38 am

It seems to be working now. It looks like the problem might have been using a full path name is <results_directory>. Once I changed that to just 'ID\' it seems to be working. So, if anyone else has this problem, there you go.

POST REPLY