opensim-org / opensim-core

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

Segmentation Fault when running and visualizing Python OpenSense Example #3422

Closed awkyu closed 1 year ago

awkyu commented 1 year ago

Specs:

I followed the directions under "Step-by-step instructions when using Anaconda with OpenSim 4.3+" on the opensim scripting in python page: https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+in+Python#ScriptinginPython-SpecialinstructionsforPython3.8+onWindows:

I opened OpenSim so that it moved the Resources folder into my Documents folder. I also created my environment according to the .yml file given and followed the directions to install opensim after activating the opensim_scripting env.

When I run the OpenSenseExample:

[info] Creating offset frame for torso_imu [info] Added offset frame for torso_imu. [info] torso_imu offset computed from torso_imu data from file. [info] Processing pelvis_imu [info] Computed offset for pelvis_imu [info] Offset is [0.280953,0.00157552,0.95972] [0.957527,0.0671338,-0.280421] [-0.0648715,0.997743,0.0173528]

[info] Creating offset frame for pelvis_imu [info] Added offset frame for pelvis_imu. [info] pelvis_imu offset computed from pelvis_imu data from file. [info] Processing tibia_r_imu [info] Computed offset for tibia_r_imu [info] Offset is [0.0965278,0.977377,-0.188191] [0.989909,-0.113978,-0.0842017] [-0.103746,-0.178164,-0.978516]

[info] Creating offset frame for tibia_r_imu [info] Added offset frame for tibia_r_imu. [info] tibia_r_imu offset computed from tibia_r_imu data from file. [info] Processing femur_r_imu [info] Computed offset for femur_r_imu [info] Offset is [-0.0408079,0.969041,-0.243505] [0.996553,0.0570898,0.0601841] [0.0722225,-0.24021,-0.968031]

[info] Creating offset frame for femur_r_imu [info] Added offset frame for femur_r_imu. [info] femur_r_imu offset computed from femur_r_imu data from file. [info] Processing tibia_l_imu [info] Computed offset for tibia_l_imu [info] Offset is [0.0950796,-0.941402,0.323607] [0.992984,0.0667322,-0.0976203] [0.070305,0.330618,0.941142]

[info] Creating offset frame for tibia_l_imu [info] Added offset frame for tibia_l_imu. [info] tibia_l_imu offset computed from tibia_l_imu data from file. [info] Processing femur_l_imu [info] Computed offset for femur_l_imu [info] Offset is [0.15939,-0.980766,0.112659] [0.985443,0.164899,0.0413474] [-0.0591295,0.104428,0.992773]

[info] Creating offset frame for femur_l_imu [info] Added offset frame for femur_l_imu. [info] femur_l_imu offset computed from femur_l_imu data from file. [info] Processing calcn_r_imu [info] Computed offset for calcn_r_imu [info] Offset is [0.132853,0.838951,-0.527742] [0.052645,-0.537683,-0.841502] [-0.989737,0.0840129,-0.115599]

[info] Creating offset frame for calcn_r_imu [info] Added offset frame for calcn_r_imu. [info] calcn_r_imu offset computed from calcn_r_imu data from file. [info] Processing calcn_l_imu [info] Computed offset for calcn_l_imu [info] Offset is [0.055168,-0.866604,-0.495938] [0.00919381,0.497114,-0.867636] [0.998435,0.0433062,0.0353922]

[info] Creating offset frame for calcn_l_imu [info] Added offset frame for calcn_l_imu. [info] calcn_l_imu offset computed from calcn_l_imu data from file. Segmentation fault

I'm not sure what is causing the segmentation fault, let me know if you need any more clarification or if I should try anything. Thanks!

awkyu commented 1 year ago

More information from python faulthandler

Windows fatal exception: access violation

Current thread 0x00004abc (most recent call first): File "C:\Users\Alexander\anaconda3\envs\opensim_scripting\lib\site-packages\opensim\simulation.py", line 34606 in run

awkyu commented 1 year ago

After completely reinstalling both Anaconda, OpenSim 4.4 and the Microsoft Visual C++ 2015-2019 Redistributable multiple times, the segmentation fault stopped occurring. Not entirely sure of the cause of the issue, but fresh reinstalls of everything seemed to fix the problem.