Differentiable Simulation of Hard Contacts with Soft Gradients for Learning and Control

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Paulus, Anselm, Geist, A. René, Schumacher, Pierre, Musil, Vít, Rappenecker, Simon, Martius, Georg
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910064027107328
author Paulus, Anselm
Geist, A. René
Schumacher, Pierre
Musil, Vít
Rappenecker, Simon
Martius, Georg
author_facet Paulus, Anselm
Geist, A. René
Schumacher, Pierre
Musil, Vít
Rappenecker, Simon
Martius, Georg
contents Contact forces introduce discontinuities into robot dynamics that severely limit the use of simulators for gradient-based optimization. Penalty-based simulators such as MuJoCo, soften contact resolution to enable gradient computation. However, realistically simulating hard contacts requires stiff solver settings, which leads to incorrect simulator gradients when using automatic differentiation. Contrarily, using non-stiff settings strongly increases the sim-to-real gap. We analyze penalty-based simulators to pinpoint why gradients degrade under hard contacts. Building on these insights, we propose DiffMJX, which couples adaptive time integration with penalty-based simulation to substantially improve gradient accuracy. A second challenge is that contact gradients vanish when bodies separate. To address this, we introduce contacts from distance (CFD) which combines penalty-based simulation with straight-through estimation. By applying CFD exclusively in the backward pass, we obtain informative pre-contact gradients while retaining physical realism.
format Preprint
id arxiv_https___arxiv_org_abs_2506_14186
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Differentiable Simulation of Hard Contacts with Soft Gradients for Learning and Control
Paulus, Anselm
Geist, A. René
Schumacher, Pierre
Musil, Vít
Rappenecker, Simon
Martius, Georg
Robotics
Machine Learning
Systems and Control
I.2.9; I.2.6; I.6.4; G.1.6
Contact forces introduce discontinuities into robot dynamics that severely limit the use of simulators for gradient-based optimization. Penalty-based simulators such as MuJoCo, soften contact resolution to enable gradient computation. However, realistically simulating hard contacts requires stiff solver settings, which leads to incorrect simulator gradients when using automatic differentiation. Contrarily, using non-stiff settings strongly increases the sim-to-real gap. We analyze penalty-based simulators to pinpoint why gradients degrade under hard contacts. Building on these insights, we propose DiffMJX, which couples adaptive time integration with penalty-based simulation to substantially improve gradient accuracy. A second challenge is that contact gradients vanish when bodies separate. To address this, we introduce contacts from distance (CFD) which combines penalty-based simulation with straight-through estimation. By applying CFD exclusively in the backward pass, we obtain informative pre-contact gradients while retaining physical realism.
title Differentiable Simulation of Hard Contacts with Soft Gradients for Learning and Control
topic Robotics
Machine Learning
Systems and Control
I.2.9; I.2.6; I.6.4; G.1.6
url https://arxiv.org/abs/2506.14186