Differentiable contact kinematics

Collision detection with analytical derivatives.

iDCOL computes contact — distance, location, normal — and its exact derivatives, for any pair of strictly convex bodies. Every contact reduces to the same fixed six-dimensional KKT system, solved in microseconds, regardless of the geometry.

Transformation of implicit geometry

Every body is φ(x) = 0, moved by scaling and a rigid transform.

Shown here in 2D for simplicity — an ellipse standing in for the paper's 3D primitives — but the transformation itself is dimension-agnostic: the reference body φ(x)=0 becomes φ(RT(x − r)/α)=0 under scale α, rotation R, and translation r.

scale α1.00
rotation θ

Dashed = reference body φ(x)=0 at the origin. Solid = the same body under φ(RT(x − r)/α)=0. Drag to set the translation r, sliders control scale α and rotation θ.

Geometry-level smoothing

One dial: exactness at one end, differentiability at the other.

Each family carries exactly one smoothing parameter — β for the log-sum-exp families (polytope, truncated cone), n for the superquadric families (ellipsoid, cylinder). Turn it up and the corners sharpen back into the exact, non-strictly-convex primitive; turn it down and they round off into a strictly convex surface that's differentiable everywhere — exactly what iDCOL's Newton solve needs. It's a single dial between geometric exactness and differentiability, not a compromise between them.

smoothing β12.0

From geometry to algebra

Whatever the shape, the same six equations.

Growth distance turns contact into a constrained program: grow (or shrink) both bodies about their own centers by the same factor α until they just touch. Its KKT conditions collapse that program into six scalar equations in six unknowns — no inequality constraints, no combinatorics, just a root to find.

minimizex, α α subject to φ1(x/α) ≤ 0 φ2(RT(x − r)/α) ≤ 0 α ≥ 0
grow both bodies until they touch
KKT conditions
F(z) = 0
6 equations, 6 unknowns
F1  =  φ1  =  0
feasibility, body 1
F2  =  φ2  =  0
feasibility, body 2
F3:5  =  λ1xφ1 + λ2xφ2  =  0
stationarity in x
F6  =  1 + λ1φ1,α + λ2φ2,α  =  0
stationarity in α

Jc = ∂F/∂z, fully analytic — no finite differences.

z+  =  z  −  Jc−1(z) F(z)
Newton step

iDCOL casts collision as a 6-variable, 6-equation root-finding problem!

Surrogate formulation

Equal treatment for extremely close or astronomically distant contact pairs.

Two configurations break a naive Newton solve: bodies nearly coincident (α* → 0) and bodies far apart (α* → ∞). The surrogate problem rescales the relative translation into one well-conditioned range — near or far, every case is tamed.

rotation θ (body B)30°

Drag body B, or use the slider to spin it. 1.00 = αmin, the bounding-sphere gap ratio. Surrogate moves body B (pushing it out if close, pulling it in if far), same direction and rotation, until the spheres just touch.

Live in your browser

Play with the original iDCOL solver.

This is the actual iDCOL C++ solver — the same idcol_solve.cpp compiled to WebAssembly, running natively in this page. Pick two shapes, pose body B freely in 6D, and press Iteration to watch each real Newton step converge.

tx (body B)2.20
ty0.60
tz0.00
roll
pitch20°
yaw

Not solved yet — press Solve or Iteration.

Solid = both bodies at their true pose (α=1). Transparent = both bodies scaled by the solved α*. Red dot = the shared contact point x*.

The whole point

Differentiability is the whole point.

Gradient-based planning, control, and simulation all need derivatives of contact — distance, location, normal — with respect to robot state. Finite differences are slow and noisy. iDCOL gets exact derivatives by differentiating straight through the KKT solve itself.

∂z*/∂θ  =  −(∂f/∂z)−1 ∂f/∂θ
the implicit function theorem: differentiate z* without re-solving f(z*,θ) = 0
applied to the KKT residual
∂z*/∂q  =  T J(q),   Jc T = −∂F/∂q
Jc is the same KKT Jacobian already factored during the Newton solve — no extra linear system

q is the robot's generalized coordinates, J(q) its geometric Jacobian, and ∂F/∂q is chain-ruled through the relative pose g(q).

Every derivative of contact kinematics falls out of one extra, nearly free linear solve.

Applications

From gradients to motion.

Applications in gradient-based path planning and differentiable contact physics.

Kinematic path planning Quadrotor

An RRT-initialized path through eight static obstacles, refined by gradient-based optimization with iDCOL collision constraints.

Kinematic path planning Serial robot (UR10)

A 6-DOF manipulator, its links convex-decomposed into 8 ellipsoids, planned around three obstacles across 24 collision pairs.

Contact physics Multibody collision

Ten strictly convex bodies — cones, cylinders, ellipsoids, polytopes — colliding freely across 45 contact pairs.

Contact physics Soft manipulator

A tendon-actuated Cosserat-rod arm, modeled as a chain of smooth truncated cones, contacting the ground and two rigid obstacles.

Know before you use it

What differentiability costs you.

iDCOL trades some things for speed and differentiability. Practitioners should know where those trades bite.

Nonconvex geometry needs decomposition

Complex or nonconvex robot links have to be split into convex pieces first; each piece is then solved within the same framework.

Smoothing costs geometric fidelity

Sharp edges, flat faces, narrow regions, and high-aspect-ratio features get rounded off by the smooth approximation. Raising β or n recovers accuracy but can hurt numerical conditioning.

Locally convergent solver

The Newton solve isn't globally convergent. The surrogate problem and warm-starting help in practice, but challenging configurations can still need a better initial guess.

One contact point per pair

Strict convexity means a single witness point per body pair — distributed line or surface contact (a box resting flush on a table) isn't directly represented.

Supported geometry

Five built-in families — or create your own.

The sphere and four smoothed families below cover most robotics primitives. Any strictly convex implicit surface works just as well — supply φ, ∇φ, ∇2φ and iDCOL treats it the same way, as shown by the last card.

Quickstart

Three calls: shapes, pair, solve.

main.cpp
// A, b: half-space constraints Ax <= b, one row per face
auto poly  = make_poly(20.0, A, b);
auto ellip = make_se(1.0, 0.5, 1.0, 1.5);

// A contact pair solves for the shared touching point
ContactPair pair(poly, ellip);

Eigen::Matrix4d g = Eigen::Matrix4d::Identity();
g.topRightCorner<3,1>() << 0.2, 0.1, 0.3;

SolveResult out = pair.solve(g);
if (out.newton.converged) {
    std::cout << "alpha = " << out.newton.alpha;
}
Citation

If this is useful in your work.

bibtex
@article{mathew2026iDCOL,
  title   = {Collision Detection With Analytical Derivatives of Contact Kinematics},
  author  = {Anup Teejo Mathew and Anees Peringal and Daniele Caradonna
             and Frederic Boyer and Federico Renda},
  journal = {IEEE Robotics and Automation Letters},
  year    = {2026},
  doi     = {10.1109/LRA.2026.3732913}
}