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
How to extract ground reaction forces from OpenCap trials?
- Camille Frayssinhes
- Posts: 13
- Joined: Thu Nov 16, 2023 9:42 am
- Antoine Falisse
- Posts: 438
- Joined: Wed Jan 07, 2015 2:21 am
Re: How to extract ground reaction forces from OpenCap trials?
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
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
- Camille Frayssinhes
- Posts: 13
- Joined: Thu Nov 16, 2023 9:42 am
Re: How to extract ground reaction forces from OpenCap trials?
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
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
- Attachments
-
- Screenshot 2023-11-29 at 11.20.58.png (50.03 KiB) Viewed 1178 times
- Antoine Falisse
- Posts: 438
- Joined: Wed Jan 07, 2015 2:21 am
Re: How to extract ground reaction forces from OpenCap trials?
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
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?
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:antoinefalisse wrote: ↑Wed Nov 29, 2023 12:20 pmHi,
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
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?
- Antoine Falisse
- Posts: 438
- Joined: Wed Jan 07, 2015 2:21 am
Re: How to extract ground reaction forces from OpenCap trials?
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
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