Thanks for the great project. I'm trying to use MocoTrack with a marker trajectory .trc file that I collected myself and solve for the muscle activations that tracks the trajectory. However, after following the tutorial and examples, I'm having a hard time getting the solver to converge. It would either error out with:
Code: Select all
Error evaluating Jacobian of equality constraints at user provided starting point.
Code: Select all
nlp:nlp_g failed: NaN detected for output g, at ......
I would hugely appreciate any help or pointers to resolve this problem. Would this be related to the model itself, the marker alignment, optimizer configs, or something that I did wrong in my code?
What I have tried:
- scaling the model using the scaling tool, adjusting marker placement to match experimental markers
- tuning objective weights
- tuning optimizer parameters
- trying different initial time steps
- trying different initial guesses using the createGuess and randomizeAdd functions
Some strange observations:
- Using the exact same code, some times it works if I pipe the std output to a file instead of in the terminal.
- Using the exact same code, it works if I truncate the .trc file to 6 time steps (t = [0.0, 0.031]), but it doesn't work if I use the full .trc file with 800+ time steps but only set the time range for MocoTrack to (t = [0.0, 0.031]) using set_initial_time and set_final_time
Here is a link (https://github.com/RealZiangLiu/opensim-moco-issue) to the .osim model and .trc files.
Code structure:
- testMocoTrack.py: main script
- model.osim: model file, scaled using OpenSim according to .trc file
- motion_[1/2/3]_modified.trc: mocap marker trajectory files
- motion_[1/2/3]_log.txt: log files from my attempts at running the optimization
Thank you in advance.