Fast and Feature-Complete Differentiable Physics for Articulated Rigid Bodies with Contact
Keenon Werling, Dalton Omens, Jeongseok Lee, Ioannis Exarchos, C. Karen Liu
TL;DR
The paper introduces Nimble, a fast differentiable physics engine that extends DART to compute analytical gradients for Lagrangian articulated rigid-body dynamics with hard contact constraints. It achieves this by a sparse, QP-free differentiation of the linear complementarity problem that governs contact impulses, complemented by efficient, geometry-aware gradients for collision contacts and an elastic-time collision approximation to preserve gradient quality through bounces. It also tackles learning-time challenges by proposing subgradient strategies to escape saddle points and by stabilizing LCP solutions to ensure consistent gradient behavior. Empirical results show significant speedups over finite-difference methods and demonstrate robust gradient-driven optimization in contact-rich scenarios, enabling real-time or near-real-time differentiable simulations on complex robotic systems.
Abstract
We present a fast and feature-complete differentiable physics engine, Nimble (nimblephysics.org), that supports Lagrangian dynamics and hard contact constraints for articulated rigid body simulation. Our differentiable physics engine offers a complete set of features that are typically only available in non-differentiable physics simulators commonly used by robotics applications. We solve contact constraints precisely using linear complementarity problems (LCPs). We present efficient and novel analytical gradients through the LCP formulation of inelastic contact that exploit the sparsity of the LCP solution. We support complex contact geometry, and gradients approximating continuous-time elastic collision. We also introduce a novel method to compute complementarity-aware gradients that help downstream optimization tasks avoid stalling in saddle points. We show that an implementation of this combination in an existing physics engine (DART) is capable of a 87x single-core speedup over finite-differencing in computing analytical Jacobians for a single timestep, while preserving all the expressiveness of original DART.
