Tutorial 5 – Ground Contact Personalization
Tutorial Developers: Robert Salati, Spencer Williams, and B.J. Fregly, Rice Computational Neuromechanics Lab, Rice University
Last Updated: 11/4/2025
The Ground Contact Model Personalization tool finds physical properties for elastic foundation foot–ground contact models that closely reproduce experimental ground reaction forces and moments while allowing slight changes in foot kinematics. The elastic foundation is composed of a uniform grid of linear springs with nonlinear damping and friction placed across the bottom of the foot. A personalized foot-ground contact model is important for predicting new movements because ground reaction forces and moments will change with the new movements.
The inputs to the GCP tool are a post-JMP lower-body or full-body OpenSim model along with IK motion and associated ground reaction data for a walking trial, where the IK and ground reaction data must possess the same time increments.
Before running GCP:
Open the OpenSim model
BodyModel.osimin the OpenSim GUI.GCP uses the model’s default pose to place springs on the foot. It is important that this model has the feet flat on the ground and at the correct height above the ground. With these criteria, the static pose is generally a good choice for the default pose.
Run OpenSim Inverse Kinematics on
BodyModel.osimwith the premade settings fileIKSettingsStaticPose.xml.Click on the Coordinates tab
Under poses, click Set Default and save the model. The default model pose is now the static trial pose.
Setting up a GCP settings file:
Activate the NMSM GUI in OpenSim by navigating to Tools>User Plugins, and click
rcnlPlugin.dll.With bodyModel.osim selected in the OpenSim GUI, navigate to Tools>Model Personalization>Ground Contact Personalization.
a. The following window should be opened:

Leave the Osimx file field empty.
Choose the motion file to be
preprocessed\IKData\gait_1.stoChoose the ground reactions file to be
preprocessed\GRFData\gait_1.stoChoose the results directory to be
GCPResultsV1Add a new contact surface named
Right FootSet the time range to
0.5 – 1.6Set the belt speed to
1.4Set the force columns to
ground_force_2_vx ground_force_2_vy ground_force_2_vzSet the moment columns to
ground_moment_2_mx ground_moment_2_my ground_moment_2_mzSet the electrical center columns to
ground_force_2_px ground_force_2_py ground_force_2_pzSet Hindfoot Body to
calcn_ra. Tip: You can type inside the drop down menu to get to the option you want faster.
Set the markers as follows:
- Toe Marker: R_Toe
- Medial Marker: R_Toe_Medial
- Heel Marker: R_Heel
- Lateral Marker: R_Toe_Lateral
- Midfoot Superior Marker: R_Midfoot_SuperiorYour full contact surface should look like the following:

Save your settings file as
GCPSettingsV1.xmlOpen up
GCPSettingsV1.xmlin a text editor of your choice and explore the settings file.With a text editor, scroll to the bottom of the settings file, and change
<max_iterations>to20.a. This is to make the optimization terminate earlier to save time.
Running GCP:
Open MATLAB and open
runGCP.min your tutorial directory.Open the project file
Project.prjinside your installation ofnmsm-core.Ensure MATLAB is set up to use multi-processing, not multi-threading:
a. In the bottom left of MATLAB, click the parallel processing icon, and click parallel preferences.
b. In the drop down menu for Default Profile, select Processes.
Run the MATLAB section labelled
Run GCP V1a. With the section selected, press control+enter to run a section.
While running GCP:
a. In the OpenSim GUI, open and inspect the model
footModel_1.osimb. To simplify the optimization, GCP only uses foot kinematics instead of full body kinematics.
c. The location of the springs is determined by the default pose of the osim model. To place the springs well, it is important that the full body model’s feet are flat on the ground and placed at an appropriate height.
Post GCP analysis:
Look through the plots created by the script. If everything was done correctly, there should be 3 plots.
Plot 1 – Ground Reaction Matching: Ground reaction forces and moments produced by the contact model plotted against experimental ground reactions.
Plot 2 – Kinematics: Adjusted foot kinematics produced by the optimization.
Plot 3 – Stiffness Coefficients: A grid of stiffness coefficients for each foot.
Experiment with electrical center adjustment:
Create a copy of
GCPSettingsV1.xmland name itGCPSettingsV2.xmlOpen
GCPSettingsV2.xmlin a text editor of your choice.Change the
<results_directory>toGCPResultsV2.In task 3 of your
<GCPTaskSet>, change<electricalCenterX>and<electricalCenterZ>totrue.Save this settings file as
GCPSettingsV2.xmlRun the MATLAB section labelled
Run GCP V2a. With the section selected, press control+enter to run a section.
Experiment with viscous friction:
Create a copy of
GCPSettingsV1.xmland name itGCPSettingsV3.xmlOpen
GCPSettingsV3.xmlin a text editor of your choice.Change the
<results_directory>toGCPResultsV3.In all tasks, set
<dynamicFrictionCoefficient>tofalse, and<viscousFrictionCoefficient>totrue.At the bottom of the settings file, set
<initial_dynamic_friction_coefficient>to0, and<initial_viscous_friction_coefficient>to5.Save this settings file as
GCPSettingsV3.xmlRun the MATLAB section labelled
Run GCP V3a. With the section selected, press control+enter to run a section.
Experiment with grid density:
Create a copy of
GCPSettingsV1.xmland name itGCPSettingsV4.xmlOpen
GCPSettingsV4.xmlin a text editor of your choice.Change the
<results_directory>toGCPResultsV4.At the top of the file, set
<grid_width>to8, and<grid_height>to15.Save this settings file as
GCPSettingsV4.xmlRun the MATLAB section labelled
Run GCP V4a. With the section selected, press control+enter to run a section.