Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is up to date with lucasrm25/Using-Model-Knowledge-for-Learning-Forward-Dynamics:main.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Using Physics Knowledge for Learning Rigid-body Forward Dynamics with Gaussian Process Force Priors

Code related to the paper "Using Physics Knowledge for Learning Rigid-body Forward Dynamics with Gaussian Process Force Priors" accepted at the Conference on Robot Learning (CoRL) 2021.


Main S-GP implementation can be found here: sgp/

How to execute the experiments

Generate Dataset

Before starting the to train the models, it is necessary to generate the dataset, obtained from simulation. To do that, execute the script, which requires, among other libraries, the pyBullet library installed.

This will execute the simulation and save the simulation results to KUKA-experiment/results/KUKA-surf-dataset/simdata_raw.dat. The name and location of the file, as well as many other simulation settings can be changed in the configuration file



Next, execute the script that generates a dataset file KUKA-experiment/results/KUKA-surf-dataset/simdata.dat. We are now ready to train the proposed learning methods.

Mean Absolute Error vs. Number of training points

In this experiment we compare the performance of a vanilla GP to the proposed Structured-GP w.r.t. to the number of training points used. Optionaly, an analytical model is used as a mean function to the S-GP. Execute the following main scripts to train the models

At the top of each script, you find the path to the model configuration file. Please, make sure you find the following path

cfg_model = importlib.import_module('results.KUKA-surf-dataset.exp_MAEvsTrainpoints.config_ML')

which points to exp_MAEvsTrainpoints/

Inside the config_ML file, there is an option s_gp.use_Fa_mean = False, that lets you change wheter the S-GP will use the analytical model or the zero mean as a mean function. In addition, the option ds.datasetsize_train = 600 lets you change the number of traning points to be used by the different GP approaches during training.



Learning end-effector mass and CoG alongside unmodeled forces

Here, compare how the S-GP method performs when using a analytical multi-body dynamics model as a mean function, whose end-effector mass and CoG parameters are initially wrongly estimated. The S-GP approach aims at learning unmodeled friction forces alongside the analytical model parameters.

Execute the following main scripts to generate the results

and make sure the configuration file exp_learn_massCoG_alongside/ is set in the first lines of each code:

cfg_model = importlib.import_module('results.KUKA-surf-dataset.exp_learn_massCoG_alongside.config_ML')


Compare GP vs. S-GP vs Analytical Model vs. Neural Network

Execute the following main scripts to generate the results

and make sure each code points to the right configuration file exp_comp_gp-sgp-nn-mbd/

cfg_model = importlib.import_module('results.KUKA-surf-dataset.exp_comp_gp-sgp-nn-mbd.config_ML')




This project is written 100% in python. The user is only required to install all python libraries used in this project, given in requirements.txt

Some useful links:

External Softwares


License: BSD

Author(s): Thomas Moulard, David Lu, Kelsey Hawkins, Antonio El Khoury, Eric Cousineau, Ioan Sucan , Jackie Kay

KUKA robot arm model

License: Zlib


Using Model Knowledge for Learning Forward Dynamics







No releases published


No packages published


  • Python 100.0%