Table of Contents
Fetching ...

Smoothly Differentiable and Efficiently Vectorizable Contact Manifold Generation

Onur Beker, Andreas René Geist, Anselm Paulus, Nico Gürtler, Ji Shi, Sylvain Calinon, Georg Martius

TL;DR

This work proposes a framework designed from the ground up with these goals in mind, 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).

Abstract

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.

Smoothly Differentiable and Efficiently Vectorizable Contact Manifold Generation

TL;DR

This work proposes a framework designed from the ground up with these goals in mind, 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).

Abstract

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.
Paper Structure (32 sections, 10 equations, 11 figures, 1 table)

This paper contains 32 sections, 10 equations, 11 figures, 1 table.

Figures (11)

  • Figure 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.
  • Figure 2: Visualizations of how the proposed SDF primitives behave with increasing levels of smoothing.
  • Figure 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 $\bm{e}_{1}^{\star}(\theta) = [\bm{e}_{1,x}^{\star}, \bm{e}_{1,y}^{\star}, 0]$ on edge-1 as it completes a half rotation $\theta: 0 \to \pi$. Without smoothing (top left), $\bm{e}_{1}^{\star}(\theta)$ exhibits a jump as the system passes through the pathological parallel configuration $\theta = \pi/2$. The center and bottom plots visualize the smoothing contributions of L$_2$ regularization and employing the approximations from \ref{['sec:smooth_operators']}. (Right) The gradients of $\bm{e}_{1}^{\star}(\theta)$ 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.
  • Figure 4: Creating E-E Contacts: The witness points $\bm{e}_i^{\star}$, as well as the corresponding unsigned distances and normals, are obtained from the (smoothed) analytical active set method described in S.\ref{['sec:e_e_wp']}. 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.
  • Figure 5: Contact manifold visualizations for box-box collisions. SDFs are obtained from SQ primitives ($\epsilon_1 = \epsilon_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 \times 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.
  • ...and 6 more figures