Differentiable Simulation of Hard Contacts with Soft Gradients for Learning and Control
Anselm Paulus, Andreas René Geist, Pierre Schumacher, Vít Musil, Simon Rappenecker, Georg Martius
Abstract
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 penaltybased 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. Project page: https://github.com/martius-lab/diffmjx * Equal contribution.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 27a20035-c759-40ac-be85-aae89db401a2Builds on7
- Accelerated Policy Learning with Parallel Differentiable SimulationJie Xu, Viktor Makoviychuk, Yashraj Narang, Fabio Ramos et al.ICLR 2022 · 141 citations
- Learning with 3D rotations, a hitchhiker's guide to SO(3)Andreas René Geist, Jonas Frey, Mikel Zhobro, Anna Levina et al.ICML 2024 · 47 citations
- Sparsely Changing Latent States for Prediction and Planning in Partially Observable DomainsChristian Gumbsch, Martin V. Butz, Georg MartiusNeurIPS 2021 · 30 citations
- Adaptive Horizon Actor-Critic for Policy Learning in Contact-Rich Differentiable SimulationIgnat Georgiev, Krishnan Srinivasan, Jie Xu, Eric Heiden et al.ICML 2024 · 27 citations
- Simulation and Retargeting of Complex Multi-Character InteractionsYunbo Zhang, Deepak Gopinath, Yuting Ye, Jessica K. Hodgins et al.SIGGRAPH 2023 · 25 citations
Related papers
- Efficient Differentiable Contact Model with Long-range InfluenceXiaohan Ye, Kui Wu, Taku Komura, Zherong PanICLR 2026 · 2 citations
- Adaptive-Gradient Policy Optimization: Enhancing Policy Learning in Non-Smooth Differentiable SimulationsFeng Gao, Liangzhi Shi, Shenao Zhang, Zhaoran Wang et al.ICML 2024 · 7 citations
- Adaptive Barrier Smoothing for First-Order Policy Gradient with Contact DynamicsShenao Zhang, Wanxin Jin, Zhaoran WangICML 2023 · 13 citations
- DIFFTACTILE: A Physics-based Differentiable Tactile Simulator for Contact-rich Robotic ManipulationZilin Si, Gu Zhang, Qingwei Ben, Branden Romero et al.ICLR 2024 · 41 citations
- Multi-Object System Identification from VideosChunjiang Liu, Xiaoyuan Wang, Qingran Lin, Albert Xiao et al.ICLR 2026 · 2 citations
