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

Lucas Rath, Andreas René Geist, Sebastian Trimpe

Abstract

Modeling robot forward dynamics accurately is essential for control and simulation but remains challenging due to complex real-world phenomena like friction and contact forces. This paper presents a "graybox" approach that combines analytical rigid-body dynamics with Gaussian Process (GP) regression. By placing a GP prior on unknown generalized forces within the equations of motion, the proposed Structured GP (S-GP) framework ensures physical consistency, improves data efficiency, and allows for the simultaneous learning of physical parameters.

Introduction

Predicting a robot's forward dynamics—its future state given current state and control inputs—is a fundamental problem in robotics. Traditional analytical models based on pure physics are reliable for rigid structures but often fail to capture unmodeled effects such as joint elasticity or complex environmental interactions. Conversely, purely data-driven models like Neural Networks (NNs) or standard GPs require large datasets and often violate basic physical laws, such as predicting interpenetration with solid surfaces. This work bridges the gap by using known physics for kinematics and inertia while employing GPs to learn the "hard-to-model" forces.

Methodology

The core innovation lies in the placement of the learning component. Rather than learning a residual mapping for acceleration, the authors place a GP prior on the generalized forces ($Q_U$).

The proposed framework integrates multibody dynamics with a Gaussian Process force prior to predict robot acceleration while respecting surface constraints.

The framework utilizes the Lagrangian equations of motion, where acceleration ($\ddot{q}$) is derived from the inertia matrix ($M$), known forces ($Q_K$), and unknown forces ($Q_U$). Because the relationship between force and acceleration is linear-affine, and GPs are closed under linear transformations, the predicted acceleration remains a GP. Holonomic constraints, such as an end-effector maintaining contact with a surface, are incorporated via a projection matrix ($H$) and Baumgarte stabilization to prevent numerical drift. The model is implemented in PyTorch, allowing for Type-II Maximum Likelihood Estimation (MLE) to optimize both GP hyperparameters and physical constants (e.g., tool mass) simultaneously.

Experimental Setup

The model was evaluated using a simulated 7-DOF KUKA robot arm in PyBullet. The task involved the end-effector moving along linear trajectories while pressing against a surface, introducing both constraint forces and complex friction. Training sets ranging from 200 to 1,000 data points were generated using Farthest Point Sampling to test data efficiency against a larger held-out validation set.

Results

The Structured GP (S-GP) demonstrated significant improvements over baseline models in both accuracy and physical consistency.

Comparison of Mean Absolute Error (MAE) and constraint violation across different training set sizes. The S-GP models show superior data efficiency and near-zero constraint violation.

As shown in the results, the S-GP significantly outperformed standard GPs and NNs, particularly when training data was scarce. With only 200 training points, the S-GP achieved a much lower MAE. Furthermore, the inclusion of constraint equations allowed the model to maintain physical consistency; while standard models might "drift" or predict the robot passing through surfaces, the S-GP with Baumgarte stabilization successfully respected environmental boundaries.

Discussion and Limitations

A key insight is that learning underlying forces is more effective than learning accelerations directly, as forces are often simpler functions of state, whereas accelerations are nonlinearly warped by the inertia matrix. Additionally, the framework's ability to estimate physical parameters alongside friction makes it highly versatile for real-world calibration.

However, some limitations remain. The model assumes perfectly rigid links, which may not hold for soft robotics. It also requires a known kinematic "skeleton" of the robot. Future work could explore Deep Kernel Learning to handle non-stationary friction or address the $O(N^3)$ computational complexity inherent to standard GPs.

Summary updated

BibTeX
@inproceedings{rath2021using,
  author = {Lucas Rath and Andreas René Geist and Sebastian Trimpe},
  title = {{Using Physics Knowledge for Learning Rigid-body Forward Dynamics with Gaussian Process Force Priors}},
  booktitle = {Conference on Robot Learning},
  year = {2021},
}
Figure