Code: Select all
[info] Loaded model MaleFullBodyModel_v2.0_OS4 from file Model.osim
[info] AbstractTool NMB loading model Model.osim
[info] Loaded model MaleFullBodyModel_v2.0_OS4 from file Model.osim
[info] Adding force object set from Model_Actuators.xml
[info] ExternalLoads 'HandForces' was renamed and is being reset to 'externalloads'.
[info] Storage: read data file = NMB_ExternalForce1.mot (nr=11 nc=25)
[info] ExternalForce::HandForce_R Data source being set to NMB_ExternalForce1
[info] ExternalForce::HandForce_L Data source being set to NMB_ExternalForce1
[info] Loading coordinates from file 'motion_file.mot'.
[info] Storage: read data file = motion_file.mot (nr=11 nc=151)
[warning] Model::formCompleteStorages(): Did not find column /jointset/ground_pelvis/pelvis_rotation/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ground_pelvis/pelvis_list/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ground_pelvis/pelvis_tx/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ground_pelvis/pelvis_ty/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ground_pelvis/pelvis_tz/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_r/hip_flexion_r/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_r/hip_adduction_r/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_r/hip_rotation_r/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/knee_r/knee_angle_r/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ankle_r/ankle_angle_r/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_l/hip_flexion_l/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_l/hip_adduction_l/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/hip_l/hip_rotation_l/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/knee_l/knee_angle_l/value in storage object.
[warning] Model::formCompleteStorages(): Did not find column /jointset/ankle_l/ankle_angle_l/value in storage object.
[info] Found 11 state vectors with time stamps ranging from 0.0 to 1.0.
[info] Executing the analyses from 0.0 to 0.0...
[info] Storage: read data file = NMB_ExternalForce1.mot (nr=11 nc=25)
[info] ExternalForce::HandForce_R Data source being set to NMB_ExternalForce1
[info] ExternalForce::HandForce_L Data source being set to NMB_ExternalForce1
[info] Storage: read data file = NMB_ExternalForce1.mot (nr=11 nc=25)
[info] ExternalForce::HandForce_R Data source being set to NMB_ExternalForce1
[info] ExternalForce::HandForce_L Data source being set to NMB_ExternalForce1
The kernel died, restarting...
I am using OpenSim (version 4.4 with Python 3.10, np121) with Spyder running on conda 24.5.0 on Windows OS. Things I tried to find the issue:
1. Tested PyCharm and Jupyter Notebook as the IDE. Same error.
2. Tested with the latest version of conda and OpenSim 4.5.1. Same error.
3. Tested directly in OpenSim software, and it is working there.
4. Created a minimal working example, attached here. Main.py file is the main file.
My colleague is running into the same issue. Could someone help me please?
This is my main file:
Code: Select all
#%%
def static_optimization(input_model, mot):
import opensim as osim
model = osim.Model(input_model)
actuators = osim.ForceSet('Model_Actuators.xml')
forceset = model.updForceSet()
for i in range(0, actuators.getSize() -1):
forceset.cloneAndAppend(actuators.get(i))
analyze_tool = osim.AnalyzeTool('staticOpt_Setup_Minimum.xml')
analyze_tool.setModel(model)
analyze_tool.setStartTime(0)
analyze_tool.setFinalTime(0)
analyze_tool.setCoordinatesFileName(mot)
state = model.initSystem()
analyze_tool.run()
#%%
static_optimization('Model.osim', 'motion_file.mot')