opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
758 stars 308 forks source link

Very different results between Inverse Dynamics GUI vs Python code #3771

Closed Giopestri01 closed 2 months ago

Giopestri01 commented 2 months ago

Hello! I am using this basic function to perform Inverse Dynamics: def run_inverse_dynamics(grf_xml_path, ik_mot_path, output_folder):

Carica il modello

model = osim.Model(r"C:\Users\acer\Desktop\THESIS_GIOVANNI\Gait2354_Simbody\subject01_simbody.osim") # Assicurati di aggiungere il percorso al tuo modello OpenSim model.initSystem()

Configura l'analisi di Inverse Dynamics

idTool = osim.InverseDynamicsTool() idTool.setModel(model) idTool.setExternalLoadsFileName(grf_xml_path) idTool.setCoordinatesFileName(ik_mot_path) idTool.setOutputGenForceFileName("inverse_dynamics_prova.sto") idTool.setResultsDir(output_folder).

Esegui l'Inverse Dynamics

idTool.run()

Percorsi ai file di input

grf_xml_path = r"C:\Users\acer\Desktop\THESIS_GIOVANNI\Gait2354_Simbody\subject01_walk1_grf.xml" ik_mot_path = r"C:\Users\acer\Desktop\THESIS_GIOVANNI\Gait2354_Simbody\subject01_walk1_ik.mot" output_folder = r"C:\Users\acer\Desktop\THESIS_GIOVANNI\Gait2354_Simbody\ResultsIDON"

Esegui la funzione

run_inverse_dynamics(grf_xml_path, ik_mot_path, output_folder)

If I put the same files into the GUI, I get the first 5 more or less and the last 5/6 columns very very similar, but the other very different values. Can someone help me? It is for my master thesis, I would be very glad.

Giovanni

tkuchida commented 2 months ago

I see that this question was asked on the User's Forum and has already been answered there (topic 17873); closing this issue.