Differentiable Collision Detection: a Randomized Smoothing Approach

Louis Montaut, Quentin Le Lidec, Antoine Bambade, Vladimír Petrík, Josef Sivic, Justin Carpentier

TL;DR

This paper introduces a generic and highly efficient method to compute derivatives for collision detection between any pair of convex shapes, including complex meshes. By leveraging randomized smoothing, the authors provide a way to "see" the underlying curvature of non-smooth objects, enabling gradient-based optimization for robotics tasks like motion planning and differentiable simulation in just a few microseconds.

What Problem Does This Paper Address?

In robotics, collision detection is usually a "yes/no" or "how far?" question. However, for modern techniques like differentiable simulation or trajectory optimization, we need to know how the distance changes if we move or rotate an object slightly—we need the gradients.

The challenge is that most robots are represented by meshes. Meshes are collections of flat faces and sharp edges. If a contact point sits on a flat face, the local gradient is constant and doesn't reflect the overall "roundness" of the object. Standard derivative methods (like finite differences) often "forget" the global shape, leading to uninformative gradients that cause optimization algorithms to get stuck. Existing solutions were often limited to simple primitives like spheres or capsules; this paper seeks a systematic way to handle any convex shape.

Methods

The authors propose two main estimators based on randomized smoothing, a technique that approximates a non-smooth function by convolving it with a probability distribution (essentially "blurring" the geometry to find a smooth average).

  1. 0th-order Estimator: This treats the collision detection (GJK/EPA algorithms) as a black box. It perturbs the object's pose many times, runs the collision check, and averages the results. While robust, it is computationally expensive because it requires running the full collision pipeline dozens of times.
  2. 1st-order Estimator: This is the paper's primary contribution. Instead of smoothing the whole process, it exploits the mathematical optimality conditions of the collision. It uses implicit function differentiation to find how "witness points" (the closest points between shapes) move.
  3. The Mesh Trick: To solve the "flat face" problem of meshes, they use randomized smoothing to estimate the Hessian (local curvature) of the shape.
  4. Gumbel Distribution: For meshes specifically, they show that using a Gumbel distribution allows them to replace expensive sampling with a closed-form soft-max expression. This makes the curvature estimation nearly instantaneous.

Datasets

  • Synthetic Benchmark: 10,000 generated problems using "rough" polyhedral ellipsoids (12-vertex meshes) to test the limits of gradient accuracy on low-resolution shapes.
  • YCB Dataset: A standard robotics dataset containing high-resolution meshes of real-world household objects (e.g., cracker boxes, mustard bottles). This was used to benchmark timing and real-world applicability.

Key Insights and Ideas

  • Curvature Recovery: The "aha moment" is that randomized smoothing isn't just for noise—it's a tool to recover the lost curvature of a mesh. By "blurring" the vertices, the optimizer can sense that a flat face is part of a larger, rounded volume.
  • Analytic Efficiency: By applying the smoothing only to the local support function of the mesh rather than the entire collision algorithm, the authors turned a slow sampling problem into a fast analytic one.
  • 1st-order > 0th-order: The 1st-order estimator is a rare "free lunch": it is both significantly more accurate and an order of magnitude faster than the 0th-order sampling approach.

Key Results

  • Speed: The 1st-order Gumbel estimator computes derivatives in 1.7 to 9.7 microseconds. This is 10 to 70 times faster than traditional finite differences.
  • Precision: In contact-pose optimization tasks, the proposed 1st-order estimators reached terminal costs (errors) that were 3 orders of magnitude lower than finite differences, which frequently got stuck in local minima.
  • Integration: The method was implemented in the widely-used HPP-FCL and Pinocchio robotics libraries, making it immediately available for real-world differentiable physics pipelines.

Limitations and Future Work

  • Convexity Constraint: The current math relies on convex shapes. While non-convex objects can be decomposed into convex pieces (approximate convex decomposition), the derivatives across the boundaries of these pieces might be discontinuous.
  • Temperature Tuning: The smoothing relies on a parameter $\epsilon$ (similar to "temperature" in a soft-max). Choosing the right $\epsilon$ is a trade-off: too high and the shape becomes a blob; too low and the gradients become "jittery" again.
  • Future Directions: The authors plan to extend this work to multi-contact scenarios, optimal grasp synthesis, and full-scale differentiable simulators where collision gradients are the primary bottleneck.

Summary updated

BibTeX
@inproceedings{montaut2023differentiable,
  author = {Louis Montaut and Quentin Le Lidec and Antoine Bambade and Vladimír Petrík and Josef Sivic and Justin Carpentier},
  title = {{Differentiable Collision Detection: a Randomized Smoothing Approach}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  doi = {10.1109/icra48891.2023.10160251},
}
Figure