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

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Jingke Song
Posts: 34
Joined: Tue Oct 19, 2021 4:52 am

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

Post by Jingke Song » Mon Mar 20, 2023 5:59 am

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

Tags:

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Mon Mar 20, 2023 2:00 pm

Hi Jingke,

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

Best,
Nick

User avatar
Jingke Song
Posts: 34
Joined: Tue Oct 19, 2021 4:52 am

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

Post by Jingke Song » Mon Mar 20, 2023 8:36 pm

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.

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Tue Mar 21, 2023 11:44 am

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

User avatar
Jingke Song
Posts: 34
Joined: Tue Oct 19, 2021 4:52 am

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

Post by Jingke Song » Sat Apr 01, 2023 7:04 am

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

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Sun Apr 02, 2023 12:36 pm

Hi Jingke,

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

Best,
Nick

User avatar
Jingke Song
Posts: 34
Joined: Tue Oct 19, 2021 4:52 am

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

Post by Jingke Song » Mon Apr 03, 2023 2:22 am

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

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Mon Apr 03, 2023 9:21 am

Hi Jingke,

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

-Nick

User avatar
Jingke Song
Posts: 34
Joined: Tue Oct 19, 2021 4:52 am

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

Post by Jingke Song » Mon Apr 03, 2023 6:46 pm

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.
Attachments
opensim.log
(18.19 KiB) Downloaded 12 times

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Mon Apr 03, 2023 7:43 pm

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.

POST REPLY