Running Inverse Dynamics using Python
Posted: Thu Mar 28, 2019 4:54 am
I'm having difficulty getting Inverse Dynamics to run using python. I can run inverse dynamics using the external loads & coordinates file in the GUI but script crashes if I run it using Python. There must be something I'm missing in my code but it seems impossible to find out what it is. The error I'm receiving is stating 'Kernel died' everytime I try to run the idTool. Could anyone please help point me in the right direction?
Code: Select all
idTool = osim.InverseDynamicsTool('KneeSetupID.xml')
idTool.setModel(myModel)
idTool.setName('Subject1_Knee')
idTool.getExternalLoadsFileName()
idTool.getCoordinatesFileName()
motData = osim.Storage('Knee_40_2_IK.mot')
initial_time1 = motData.getFirstTime()
final_time1 = motData.getLastTime()
idTool.setStartTime(initial_time1)
idTool.setEndTime(final_time1)
idTool.getResultsDir()
idTool.getLowpassCutoffFrequency()
myModel.initSystem()
idTool.run()