Page 1 of 2
Predict walking pattern by using OpenSim-Moco
Posted: Wed Aug 05, 2020 2:50 am
by 04kulaburak
Dear OpenSim Users,
I am a master student at Bogazici University/Istanbul. For my master thesis, I will use Moco to predict gait pattern of pathological patients. I have tried example files in Moco but it was challenging for me to adjust those MATLAB codes for my walking pattern.
It would be quite nice, if you share with me some of example working materials which include MATLAB code regarding walking trials, in order to be a guidance for a starting point for me.
I would be appreciated your help.
All the best,
Burak KULA - Bogazici University.
Re: Predict walking pattern by using OpenSim-Moco
Posted: Fri Aug 14, 2020 8:01 am
by carlosoleto
Hello Burak,
Have you checked the example code provided by Ross Miller?
https://opensim-org.github.io/opensim-moco-site/blog/
It is very well documented and uses MATLAB.
I need to work with Python but I'm using it to study OpenSim Moco.
Hope it helps.
Best regards.
Re: Predict walking pattern by using OpenSim-Moco
Posted: Mon Aug 17, 2020 1:32 am
by 04kulaburak
Hello Carlos,
Thank you for your help and guidance. I tried to run Miller's code without any modifications and I had an error given bellow.
Do you have any idea about this error ? How can I solve it?
- Capture.PNG (17.35 KiB) Viewed 1920 times
I would like to thank you again.
Best regards,
Re: Predict walking pattern by using OpenSim-Moco
Posted: Mon Aug 17, 2020 11:48 am
by carlosoleto
Hello Burak,
I haven't gone through all the steps in the MATLAB file yet. I don't work with MATLAB.
From the error message, the solver couldn't solve the problem. It even used all its iterations.
To get something working right away, there is also the "squat-to-stand" MATLAB tutorial
https://simtk-confluence.stanford.edu/d ... t-to-stand
I'm currently working on the 2D_gait example. It worked in Python after a week of code learning/rewriting.
Hope you can solve the issue.
Best regards.
Re: Predict walking pattern by using OpenSim-Moco
Posted: Mon Aug 17, 2020 11:52 am
by chrisdembia
Carlos,
It's great to hear you got example2DWalking working in Python. Also, thank you for helping out on the forum. Would you be interested in contributing this back to the project? No pressure.
-Chris
Re: Predict walking pattern by using OpenSim-Moco
Posted: Tue Aug 18, 2020 7:37 am
by carlosoleto
Hello Chris!
Sure, it will be a pleasure to contribute. It is not the best python code (smallest line number) but it does the deal. I'm currently tweaking it (slowly) to get it working as you, Falisse and others did in
https://royalsocietypublishing.org/doi/ ... .2019.0402.
I never did a git pull before but I will try it soon. Or maybe I could just send a dropbox link
It is a pleasure to help. One minute helping someone is maybe some hours saved for science.
By the way, OpenSim Moco is AMAZING! Congratulations to the team!
Best regards.
Re: Predict walking pattern by using OpenSim-Moco
Posted: Tue Aug 18, 2020 12:13 pm
by carlosoleto
04kulaburak wrote: ↑Mon Aug 17, 2020 1:32 am
Hello Carlos,
Thank you for your help and guidance. I tried to run Miller's code without any modifications and I had an error given bellow.
Do you have any idea about this error ? How can I solve it?
Capture.PNG
I would like to thank you again.
Best regards,
Just found the same error with my simulation. It simply couldn't converge.
use:
solution = study.solve()
solution.unseal()
And it will at least show some solution. Might help you.
Best regards.
Re: Predict walking pattern by using OpenSim-Moco
Posted: Tue Aug 18, 2020 1:31 pm
by nbianco
Hi Carlos and Burak,
Could you provide more information on the solution after calling unseal()? The problem should run out of the box; it would be good to figure out what's going wrong since both of you don't see convergence.
-Nick
Re: Predict walking pattern by using OpenSim-Moco
Posted: Tue Aug 18, 2020 4:57 pm
by rosshm
Hi Burak,
As others noted, that error/warning is because Moco ceased the optimization without converging, so it "sealed" the solution at the final iteration. I assume this is so users don't accidentally miss the fact that the optimizer didn't converge.
If the optimizer exited because it exceeded the max number of iterations, you can try increasing that, or decreasing the convergence tolerances. 17 minutes is a pretty short CPU time especially if you are using the 3-D model.
The codes I uploaded should converge on a solution when run as-provided (at least, they do that on my machine) but I haven't rigorously tested them. There are some elements of them that aren't great for convergence, e.g. the arms are controlled by torque generators that don't have to have smooth torques. I keep meaning to upload some updates.
Ross
Re: Predict walking pattern by using OpenSim-Moco
Posted: Wed Aug 19, 2020 1:45 am
by karthick_ganesan
Hi all,
The optimization did converge when it was run as it is. I tried it long back. I think it took quite a few hours to converge in my machine.
Regards,
Karthick.