Simulating rigid-body dynamics with contact in a fast, massively vectorizable, and smoothly differentiable manner is highly desirable in robotics. An important bottleneck faced by existing differentiable simulation frameworks is contact manifold generation: representing the volume of intersection between two colliding geometries via a discrete set of properly distributed contact points. A major factor contributing to this bottleneck is that the related routines of commonly used robotics simulators were not designed with vectorization and differentiability as a primary concern, and thus rely on logic and control flow that hinder these goals. We instead propose a framework designed from the ground up with these goals in mind, by trying to strike a middle ground between: i) convex primitive based approaches used by common robotics simulators (efficient but not differentiable), and ii) mollified vertex-face and edge-edge unsigned distance-based approaches used by barrier methods (differentiable but inefficient). Concretely, we propose: i) a representative set of smooth analytical signed distance primitives to implement vertex-face collisions, and ii) a novel differentiable edge-edge collision routine that can provide signed distances and signed contact normals. The proposed framework is evaluated via a set of didactic experiments and benchmarked against the collision detection routine of the well-established Mujoco XLA framework, where we observe a significant speedup. Supplementary videos can be found at https://github.com/bekeronur/contax, where a reference implementation in JAX will also be made available at the conclusion of the review process.
Figures & tables
Fig. 1: We introduce a contact manifold generation framework that is smoothly differentiable, fast, and well-suited for vectorization. This is enabled by two contributions. The first is a pipeline for constructing signed distance fields (SDF) for arbitrary surfaces from a representative set of analytical primitives. These SDFs then serve two roles: (i) acting as a differentiable acceleration structure to efficiently select vertex–face (V–F) and edge–edge (E–E) contact candidates, and (ii) providing signed distances, normals, and activity indicators for V–F and E–E interactions in a way that retains curvature information (since by default, they happen between flat, planar facets). The second contribution is a method to make witness point computations for V–F and E–E pairs smoothly differentiable by solving the associated quadratic programs via an analytical active-set approach.
Fig. 2: Visualizations of how the proposed SDF primitives behave with increasing levels of smoothing.
Fig. 3: ( Left ) A didactic experiment illustrating how E-E witness points behave under the proposed smoothing scheme. There are two edges lying on the xy plane, edge-2 being fixed and extending in the x direction with y=−1.2 , and edge-1 rotating around the z axis of the origin. The colored lines plot the positions traced by the witness point e1⋆(θ)=[e1,x⋆,e1,y⋆,0] on edge-1 as it completes a half rotation θ:0→π . Without smoothing (top left), e1⋆(θ) exhibits a jump as the system passes through the pathological parallel configuration θ=π/2 . The center and bottom plots visualize the smoothing contributions of L 2 regularization and employing the approximations from Section III . ( Right ) The gradients of e1⋆(θ) for the three cases above. It can be seen that in the absence of any smoothing, the finite difference gradients are uninformative (e.g., very large near the pathological configuration), which is fixed by the proposed smoothing scheme.
Fig. 4: Creating E-E Contacts: The witness points ei⋆ , as well as the corresponding unsigned distances and normals, are obtained from the (smoothed) analytical active set method described in S. IV-D2 . The subsequent sign assignment for distances and normals in turn utilizes the SDFs by evaluating the dot product of the unsigned normal direction and the SDF gradient for the penetrated surface evaluated at each witness point.
Fig. 5: Contact manifold visualizations for box-box collisions. SDFs are obtained from SQ primitives ( ϵ1=ϵ2=0.1 ). For illustration clarity, E-E contacts use the simplest cube mesh with 8 vertices, 12 edges, and 6 faces, whereas V-S contacts use a more densely meshed version of the same cube with 98 vertices. In both cases, only half of the contact points (belonging to the top box) are visualized, resulting in two manifolds: one with 12×12=144 E-E contacts and one with 98 V-S contacts. For both, two versions are shown: a version where normals are scaled with the activity indicator (to visualize which contacts are actually selected by the routine), and a version where they are unscaled. It can be seen that normals point in the right directions, and the correct points are selected.
Fig. 6: Plots showing the speed and vectorizability of the proposed active-set approach for witness point computation (Ours, and the non-smoothed version Ours-NS), in comparison with log-barrier smoothing approaches. The latter are implemented via two interior point solvers, primal-dual Newton iterations on the KKT system (IP), and L-BFGS iterations with a log barrier penalty (IP-L). It can be seen that the proposed routines are fast and efficiently vectorizable.
Fig. 7: Plots showing the speed and vectorizability of the proposed contact manifold generation routine, compared to the analogous routine of the well-established MJX simulator. The setup involves collisions between two non-convex armadillo geometries across 100 random configurations per-trial. Surfaces are represented with up to 18 SQs each, which is a controlled variable characterizing the effects of geometry complexity on the runtime. The second controlled variable is the vectorization batch size. Notice the logarithmic scale and the orders of magnitude improvement compared to MJX.
Fig. 8: A plot demonstrating how possible simplifications within the proposed contact manifold generation framework effect runtimes across different vectorization batch sizes. Ours denotes the proposed pipeline without any simplifications, Ours-NE denotes a setting where E-E contacts are turned off and only V-S contacts are considered, and Our-NE-S denotes a setting where only one sided V-S contacts are created.
Fig. 9: Original high-resolution meshes, SQ primitive decompositions, as well as mesh and SDF representations (used by the proposed method) corresponding to the 4 objects used in simulation videos. The SQ decomposition visualizations also involve an overlay of the original high-resolution mesh, to demonstrate the representation power of SQ primitives.
Fig. 10: Larger versions of plots from Fig.6 of the main paper.
Fig. 11: Larger versions of plots from Fig.7 of the main paper.
ID
File
Description
Folder: armadillo_armadillo_rollout/
A1
angle_1.mp4
Armadillo–Armadillo collision rollout (view angle 1). Shows contact manifold behavior on a non-convex mesh pair.
A2
angle_2.mp4
Same rollout as A1 from view angle 2.
A3
angle_3.mp4
Same rollout as A1 from view angle 3.
A4
angle_4.mp4
Same rollout as A1 from view angle 4.
A5
angle_1_E_E_contacts_off.mp4
Same setup as A1, but with E–E contacts disabled (V–S only). Demonstrates the “Ours-NE” simplification discussed in the supplementary material Fig. 8 .
TABLE I: Supplementary videos. Each scenario is shown from four camera angles, plus an ablation with E–E contacts disabled (V–S only), an E–E on/off comparison, and an interactive visualizer demonstration.
Generating intelligent robot behavior in contact-rich settings is a research problem where zeroth-order methods currently prevail. Developing methods that make use of first/second order information about rigid-body dynamics in the presence of contact holds great promise in terms of increasing the solution speed and computational efficiency. The main bottleneck in this research direction is the difficulty in obtaining gradients and Hessians that are actually useful for numerical optimization, due to pathologies in all three steps of a common simulation pipeline: i) collision detection, ii) contact dynamics, iii) time integration. This abstract proposes a method that aims to address the collision detection part of the puzzle, via a novel pipeline designed from scratch with smooth (i.e. twice) differentiability and massive vectorizability on GPUs as the main priorities. This is in contrast to standard collision detection routines that are instead optimized for runtime on CPUs and minimal memory footprint, but do employ logic and control flow that hinder differentiability and vectorization. The proposed pipeline consists of the following contributions: i) highly expressive and compute efficient SDF representations, ii) differentiable broad-phase and narrow-phase routines that use these representations to generate vertex-SDF and edge-SDF contacts, iii) a differentiable routine for convex decomposition based contact blending.
Robotics simulators have improved significantly in computational speed and scalability, enabling them to generate years of simulated data for complex systems in minutes or hours. Despite these advances, efficiently and accurately computing simulation derivatives remains an open challenge. Addressing this would accelerate the convergence of reinforcement learning and trajectory optimization algorithms, particularly for contact-rich problems. This paper introduces a unifying framework for robotic simulation that accounts for all factors, including dynamics, collisions, and friction. The resulting algorithm computes analytical derivatives of the simulation by implicit differentiation, explicitly handling the intrinsic non-smoothness of the collision and frictional stages while exploiting the sparsity induced by the multi-body structure. Benchmark results demonstrate state-of-the-art performance, with timings ranging from 5μs for a 7-dof manipulator to 95μs for a 36-dof humanoid, an improvement of at least two orders of magnitude over alternative methods. Implemented in C++, the code will be open-sourced after the review process to support applications such as simulation-driven learning and real-time control.
Quentin Le Lidec, Louis Montaut, Yann de Mont-Marin +3
Inria, Ecole normale sup´erieure CNRS, PSL Research University 75005 Paris, France
Accurate physics simulation is essential for robotic learning and control, yet analytical simulators often fail to capture complex contact dynamics, while learning-based simulators typically require large amounts of costly real-world data. To bridge this gap, we propose a few-shot real-to-sim approach that combines the physical consistency of analytical formulations with the representational capacity of graph neural network (GNN)-based models. Using only a small amount of real-world data, our method calibrates analytical simulators to generate large-scale synthetic datasets that capture diverse contact interactions. On this foundation, we introduce a mesh-based GNN that implicitly models rigid-body forward dynamics and derive surrogate gradients for collision detection, achieving full differentiability. Experimental results demonstrate that our approach enables learning-based simulators to outperform differentiable baselines in replicating real-world trajectories. In addition, the differentiable design supports gradient-based optimization, which we validate through simulation-based policy learning in multi-object interaction scenarios. Extensive experiments show that our framework not only improves simulation fidelity with minimal supervision but also increases the efficiency of policy learning. Taken together, these findings suggest that differentiable simulation with few-shot real-world grounding provides a powerful direction for advancing future robotic manipulation and control.
Zhenhao Huang, Siyuan Luo, Bingyang Zhou +3
National University of Singapore, Singapore · Prana Lab, San Francisco, USA