Page 1 of 2

After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Mar 20, 2023 5:59 am
by sjk123
After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Mar 20, 2023 2:00 pm
by nbianco
Hi Jingke,

You can use the OpenSim utility function 'createExternalLoadsTableForGait' to compute contact forces. See example2DWalking for a usage example.

Best,
Nick

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Mar 20, 2023 8:36 pm
by sjk123
Thank you very much for your reply, but I want to accurately obtain the contact force generated when the heel and toe respectively contact the ground, rather than the ground reaction force converted to the pressure center.

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Tue Mar 21, 2023 11:44 am
by nbianco
Hi Jinke,

If you want the contact forces from individual contact spheres, you can recreate what 'createExternalLoadsTableForGait' computes internally, and just return the contact sphere forces you want instead.

Best,
Nick

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Sat Apr 01, 2023 7:04 am
by sjk123
Hi Nick
I now want to extract the desired output information from the Moco results using the following code:

solution = study.solve();
outputs = StdVectorString();
outputs.add('.*active_force_length_multiplier');
table = study.analyze(solution, outputs);

However, the following warning message appears:
Warning: No outputs were connected to 'reporter' of type TableReporter__double_. You can connect outputs by calling addToReport().

I don't know how to solve this problem, and I hope to receive your reply!

Best,
Jingke

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Sun Apr 02, 2023 12:36 pm
by nbianco
Hi Jingke,

I noticed you figured out the other reporting issue, did you still need help here?

Best,
Nick

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Apr 03, 2023 2:22 am
by sjk123
Thank you for your reply. I have already resolved this issue, but now I have encountered another issue. I built a simple exoskeleton robot and connected it to the human body through three bushingforces. Finally, it successfully ran in Moco and achieved the desired results. However, without changing any model parameters, I conducted a moco simulation again. When I ran the solution command, the MATLAB software would automatically crash. After repeated attempts, the software would still automatically crash and exit when solving.I don't know what caused this?

best,
Jingke

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Apr 03, 2023 9:21 am
by nbianco
Hi Jingke,

Do you have a crash report/dump from Matlab that you could attach?

-Nick

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Apr 03, 2023 6:46 pm
by sjk123
Only one opensim. log file was generated. I found that when I reduce the number of bushingforces, MOCO can simulate successfully, and the fewer bushingforces, the shorter the simulation time.When the number of bushingforces exceeds one, MATLAB software often crashes.

Re: After using Moco simulation, how to extract the contact force between the sole of the foot and the ground?

Posted: Mon Apr 03, 2023 7:43 pm
by nbianco
Unfortunately that log file doesn't contain any useful information.

How are the bushing forces applied to the model? Is it possible that the forces could be going to infinity and causing a crash? You could try adding infinitely strong residual forces to the model to see if that prevents a crash.