Predict walking pattern by using OpenSim-Moco
- Burak Kula
- Posts: 31
- Joined: Wed Dec 04, 2019 3:34 pm
Predict walking pattern by using OpenSim-Moco
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.
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.
- Carlos Gonçalves
- Posts: 139
- Joined: Wed Jun 08, 2016 4:56 am
Re: Predict walking pattern by using OpenSim-Moco
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.
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.
- Burak Kula
- Posts: 31
- Joined: Wed Dec 04, 2019 3:34 pm
Re: Predict walking pattern by using OpenSim-Moco
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?
I would like to thank you again.
Best regards,
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?
I would like to thank you again.
Best regards,
- Carlos Gonçalves
- Posts: 139
- Joined: Wed Jun 08, 2016 4:56 am
Re: Predict walking pattern by using OpenSim-Moco
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.
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.
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: Predict walking pattern by using OpenSim-Moco
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
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
- Carlos Gonçalves
- Posts: 139
- Joined: Wed Jun 08, 2016 4:56 am
Re: Predict walking pattern by using OpenSim-Moco
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.
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.
- Carlos Gonçalves
- Posts: 139
- Joined: Wed Jun 08, 2016 4:56 am
Re: Predict walking pattern by using OpenSim-Moco
Just found the same error with my simulation. It simply couldn't converge.04kulaburak wrote: ↑Mon Aug 17, 2020 1:32 amHello 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,
use:
solution = study.solve()
solution.unseal()
And it will at least show some solution. Might help you.
Best regards.
- Nicholas Bianco
- Posts: 1051
- Joined: Thu Oct 04, 2012 8:09 pm
Re: Predict walking pattern by using OpenSim-Moco
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
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
- Ross Miller
- Posts: 375
- Joined: Tue Sep 22, 2009 2:02 pm
Re: Predict walking pattern by using OpenSim-Moco
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
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
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: Predict walking pattern by using OpenSim-Moco
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.
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.