A Tutorial on Complementarity-Based Contact Models for Robotics

Onur Beker, A. René Geist, Michael Posa, Marc Toussaint, Justin Carpentier, Georg MartiusarXiv 2026 · arXiv

TL;DR

This tutorial provides a unified, pedagogical roadmap for understanding how modern physics engines (like MuJoCo, Drake, and Bullet) model robotic contact using cone complementarity. By bridging the gap between rigid-body dynamics and conic optimization, the authors clarify the mathematical "magic" behind non-penetration and friction, while exposing the physical trade-offs inherent in different numerical solvers.

What Problem Does This Paper Address?

Simulating a robot interacting with its environment is notoriously difficult. Contact is a multi-scale, non-smooth phenomenon: one moment a foot is in the air (no force), and the next it hits the ground (sudden, large force). Traditional "mechanistic" models that try to simulate every microscopic atomic interaction are computationally impossible for robotics.

Instead, roboticists use "phenomenological" models that focus on what contacts do—preventing penetration and dissipating energy through friction—rather than how they do it at a molecular level. Most high-performance simulators rely on cone complementarity formulations to achieve this. However, the background required to understand these models is often scattered across computational mechanics, computer graphics, and optimization literature. This paper provides a self-contained, unified treatment specifically for the robotics community.

Figure 1: An example of rigid-body system and its quantities. A planar two-link arm (bodies 1 and 2) on a fixed base pushes a free-floating box (body 3). The generalized coordinates 𝑞= (𝑞1,𝑞2,𝑞3) are the two joint angles and the pose of the box, and the joint torques constitute the controls 𝑢= (𝑢1,𝑢2, 0), as the box is not actuated. Each body 𝑘has a mass 𝑚𝑘, an inertia tensor 𝐼𝑘, a rotation matrix 𝑅𝑘, and a spatial velocity (𝑣𝑘, 𝑤𝑘) = 𝐽𝑘¤𝑞; to avoid clutter, each of these quantities is drawn on one body only. Where the arm touches the box, it exerts the force 𝑓on the box at an application point with kinematic Jacobian 𝐽. Gravity acts along 𝑔ˆ𝑒𝑧.

Methods

The tutorial systematically builds the contact problem from the ground up:

  1. Rigid-Body Dynamics: It starts with standard Newton-Euler equations and their discrete-time counterparts.
  2. Conic Optimization: It introduces the geometry of convex cones, which are essential for modeling friction (where the friction force must lie within a "cone" defined by the normal force and the friction coefficient).
  3. Transcriptions: The authors present five equivalent ways to write the exact contact problem, including the Signorini-Coulomb conditions and Nonlinear Cone Complementarity (N-CCP).
  4. Convex Relaxations: To make problems easier to solve, simulators often "relax" the math. The paper explains how dropping certain terms (like the "de Saxcé correction") results in convex problems like Linear Cone Complementarity (L-CCP) or Quadratic Programs (QP).
  5. Algorithmic Solutions: It compares various solvers, from simple first-order methods like Projected Gauss-Seidel (PGS) to more complex Nonsmooth Newton and Interior-Point methods.
An overview of the various mathematical transcriptions of contact, categorized by their form and physical fidelity.

Datasets

Not discussed in the paper. As a tutorial, it focuses on mathematical derivations and theoretical comparisons rather than empirical evaluation on specific datasets.

Key Insights and Ideas

  • Complementarity as a "Switch": Complementarity conditions act as algebraic switches. They allow the simulation to automatically determine if a contact is separating, sticking, or sliding without the user having to pre-define "modes."
  • The Cost of Convexity: While convex relaxations are faster and more robust to solve, they introduce physical artifacts. The most notable is "lift-off": in some relaxed models, a block sliding across a table will artificially "float" or rise off the surface because the model couples tangential sliding to normal separation.
  • The "de Saxcé Correction": This is a critical term in exact models that prevents the "lift-off" artifact. It ensures that sliding can occur with zero normal velocity, maintaining physical realism at the cost of making the optimization problem non-convex.
  • Kinetic Energy Minimization: The paper reveals that complementarity-based models can be interpreted as finding the contact forces that minimize the system's total kinetic energy after a time step, subject to non-penetration and friction constraints.
  • The Solver is Part of the Model: In systems with redundant contacts (like a box on four legs), there isn't a unique set of forces. The choice of solver (e.g., one that minimizes the norm of forces vs. one that spreads them out) effectively becomes part of the physical model.
Figure 3: Circular cones and the projection operator. Left: A 3D circular cone K, together with its dual cone K∗and polar cone K◦. Right: The action of the projection operator ΠK for the same cone, on three different parts of the domain: (i) 𝑥∈K, (ii) 𝑥∈K◦, and (iii) 𝑥∉K ∪K◦.

Key Results

The paper provides a definitive "cheat sheet" for roboticists:

  • Table 1 summarizes which transcriptions are convex, which have unique solutions, and what physical artifacts they introduce.
  • Table 2 compares algorithms (PGS, Newton, ADMM, etc.) based on their iteration cost, convergence speed, and suitability for GPUs.
  • Table 3 maps popular simulation engines to their underlying math. For example, it notes that MuJoCo uses a regularized NLS (Nonlinear Least Squares) transcription solved by a Newton method, while Bullet often relies on PGS.

Limitations and Future Work

The authors acknowledge several areas beyond the scope of this tutorial:

  • Deformable Bodies: The focus is strictly on rigid-body dynamics.
  • Event-Driven Simulation: The tutorial focuses on "time-stepping" methods (which are standard in robotics) rather than "event-driven" methods (common in high-precision mechanics).
  • Differentiable Simulation: While touched upon, the challenges of getting useful gradients through non-smooth contact for machine learning and trajectory optimization remain an active and difficult research frontier.
  • Global Convergence: Most "exact" (non-convex) solvers only guarantee local convergence, meaning they might fail or get stuck in complex, "wedged" configurations.

Summary updated

Abstract

Simulating rigid-body dynamics with contact is fundamental to robotics, from motion synthesis and control to mechanism design. Many widely used simulators rely on cone complementarity formulations, whose physical assumptions and numerical solution require substantial background. While excellent surveys, monographs, and course notes exist, they mostly address computational mechanics or computer graphics or document a single simulator. To the best of our knowledge, a self-contained pedagogical treatment for robotics, bringing these formulations and their solvers together with complete derivations and a unified notation, does not yet exist. This tutorial addresses this gap by connecting rigid-body dynamics, conic optimization, and frictional contact. In particular, we explain how complementarity conditions encode non-penetration and frictional dissipation, determining separation, sticking, and sliding without prescribed contact modes. We distinguish equivalent transcriptions from convex relaxations, showing how the latter can introduce artifacts such as lift-off and creep. We examine the existence and uniqueness of motion and contact forces, including the solver's role in selecting among multiple solutions. We then compare first-order and Newton-based methods, explain regularization and proximal strategies, and discuss trade-offs between computational cost, robustness, and physical fidelity. Connections to widely used simulators, optimal control, and differentiable simulation help readers interpret simulation results, choose suitable formulations and solvers, and develop their own contact dynamics routines.
BibTeX
@misc{beker2026tutorial,
  author = {Onur Beker and A. René Geist and Michael Posa and Marc Toussaint and Justin Carpentier and Georg Martius},
  title = {{A Tutorial on Complementarity-Based Contact Models for Robotics}},
  year = {2026},
  eprint = {2611.26600},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26600},
}
Figure