opensim-org / opensim-moco

Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.
https://opensim.stanford.edu/moco
Apache License 2.0
56 stars 15 forks source link

Running MocoInverse solve() with TabOpLowPassFilter crashes Matlab 2019a with R6025 runtime error "Pure virtual function call." #560

Open psbiomech opened 4 years ago

psbiomech commented 4 years ago

Seems to happen with all my data using preprint version 0.1.0, so just adding this in case it's an actual issue and not just me.

chrisdembia commented 4 years ago

Thanks Pras. Could you submit minimal code that reproduces the error?

chrisdembia commented 4 years ago

I’m also curious if this happens in Python or C++.

psbiomech commented 4 years ago

Will cut and paste asap - distracted by a toddler meltdown at the moment. I was just prepping IK/RRA kinematics for MocoInverse. E.g:

mocoinv = MocoInverse();
...
...
kindata = TableProcessor(ikfile);
kindata.append(TabOpLowPassFilter(6.0));
...
...
mocoinv.setKinematics(kindata);
mocoinv.set_kinematics_allow_extra_columns(true);
...
...
solution = mocoinv.solve()
psbiomech commented 4 years ago

Also I'm using MATLAB 2019a. Runs fine if I omit the append call. I set filter frequency to -1 for RRA kinematics.

chrisdembia commented 4 years ago

Pras, thank you for providing more information. I am unable to reproduce this error locally. Can you try upgrading to the 0.2.0 release and see if you still run into this issue?

psbiomech commented 4 years ago

Thanks Chris. Will do asap. Happy new year!

psbiomech commented 4 years ago

Also fyi I don't have this problem running MocoTrack/MocoStudy.

chrisdembia commented 4 years ago

Thanks; that's useful information. I'm still hoping we can reproduce the issue on our end.

psbiomech commented 4 years ago

Unfortunately, I have the same issue in Version 0.2.0 (runtime error R6025) in Matlab 2019a.

With regards to my code above, one thing I didn't mention earlier: the issue only occurs when executing mocoinv.solve(), not when the filter operation is appended to the TableProcessor using TabOpLowPassFilter. If mocoinv.solve() is run without TabOpLowPassFilter, then it runs fine.

Again, no issues with MocoTrack/MocoStudy.

I've retitled the issue to more correctly reflect this.

chrisdembia commented 4 years ago

@psbiomech , using the files you sent locally on my Mac, with Moco 0.2.0, I do not run into a crash (but I do get a NaN error). Perhaps this is a Windows issue. When I'm back in lab next week, I'll try to test this with Nick on his Windows machine.