Page 1 of 1
How to extract ground reaction forces from OpenCap trials?
Posted: Mon Nov 27, 2023 12:58 pm
by camillefray
Hi,
We performed two treadmill walking trials in healthy controls to test the OpenCap software.
It was very easy to extract the joint angles from these trials. However, I want to extract the ground reaction forces, but I really don't understand how to do that. I thought I had to import the OpenCap data into OpenSim. But once in OpenSim, I can load the model and the trial, but I don't see how to find the grf.
Could you help me with that please?
Best,
Camille
Re: How to extract ground reaction forces from OpenCap trials?
Posted: Tue Nov 28, 2023 11:00 am
by antoinefalisse
Hi Camille,
To estimate ground reaction forces, you need to generate dynamic simulations, this is not automated. We share example code for doing that, see this repository:
https://github.com/stanfordnmbl/opencap-processing and this script in particular:
https://github.com/stanfordnmbl/opencap ... inetics.py
The example_kinetics.py script contains an example for simulating treadmill walking:
https://github.com/stanfordnmbl/opencap ... cs.py#L146
Please take a look at the resources here
https://github.com/stanfordnmbl/opencap ... /OpenSimAD to learn more about dynamic simulations.
Best regards,
Antoine
Re: How to extract ground reaction forces from OpenCap trials?
Posted: Wed Nov 29, 2023 9:23 am
by camillefray
Thank you for your reply!
There are two things I'm still confused with.
First, what is the difference between the resultant GRF and the GRF .mot files? (see screenshot)
Second, how can I export the .mot files into a csv file, the same way I'm doing it with the joint angles (GRF over time)?
Thank you for your help,
Best,
Camille
Re: How to extract ground reaction forces from OpenCap trials?
Posted: Wed Nov 29, 2023 12:20 pm
by antoinefalisse
Hi,
1. To estimate GRFs, we attach contact spheres to the feet of the model. We use 6 spheres per foot. Each sphere produces forces. The resultant forces are the forces resulting from all six spheres.
2. You can use the kineticsOpenSimAD class for that. See this example
https://github.com/stanfordnmbl/opencap ... AD.py#L243. You can extract the GRFs
https://github.com/stanfordnmbl/opencap ... AD.py#L257 and then export the dataframe as a csv file, similar to how it is done here
https://github.com/stanfordnmbl/opencap ... ple.py#L67. It would look like:
opt_sol_obj = kineticsOpenSimAD(dataFolder, session_id, trial_name, case)
grfs = opt_sol_obj.get_ground_reaction_forces()
grfs.to_csv(output_path)
Antoine
Re: How to extract ground reaction forces from OpenCap trials?
Posted: Fri Dec 01, 2023 2:18 am
by luywhhh
I used the example provided here and I checked the results of GRFs and joint torques. It is amazing! But I still have several questions:
1. In example_kinetics.py, two sesstion_types are mentioned: 'overground' and 'treadmill'.
For 'overground', is it possible to calculate and analysis walking and running? The current codes only include 'squat', 'STS' and 'jump'.
For 'treadmill', I want to make sure that whether the GRF data of treadmill was used in kinetic calculation.
2. Using OpenSim, we can calculate joint contact forces. So can we get joint contact forces from MoCap or opencap-processing codes?
Re: How to extract ground reaction forces from OpenCap trials?
Posted: Mon Dec 04, 2023 4:02 pm
by antoinefalisse
Hi,
1. These are just examples from the data we had. You can analyze overground walking as well. Please inspect the examples and corresponding settings.
2. Knee joint contact forces are computed when running simulations, you can proceed similarly for the other joints and use OpenSim with the simulation results:
https://github.com/stanfordnmbl/opencap ... D.py#L2398
Best,
Antoine