TL;DR
Dojo is a new differentiable physics engine for robotics that achieves stable, "hard" contact simulation at low sample rates while providing tunable, smooth gradients for optimization. By combining a custom primal-dual interior-point solver with implicit differentiation, Dojo allows researchers to bridge the gap between physically accurate simulation and efficient gradient-based learning.
What Problem Does This Paper Address?
Modern robotics relies heavily on simulation for trajectory optimization, reinforcement learning (RL), and system identification. However, researchers face a frustrating trade-off:
- Physical Fidelity vs. Stability: Traditional engines often use "soft" contact models to maintain stability, which can lead to unphysical artifacts like robots "sinking" into the floor or "creeping" while at rest.
- Differentiability vs. Horizon Length: Differentiable simulators often require very high sample rates (thousands of Hertz) for stability. When training over long time horizons, differentiating through these thousands of steps leads to the "vanishing/exploding gradient" problem, making learning nearly impossible.
Dojo tackles these by rethinking the underlying numerics, moving away from the "soft" approximations common in engines like MuJoCo and toward a robust, optimization-first architecture.
Methods
Dojo’s architecture is built on several key pillars:
- Maximal-Coordinates Representation: Unlike minimal-coordinate engines that use joint angles, Dojo explicitly represents the 6-DOF pose of every rigid link. This results in larger but sparser systems of equations that can be solved in linear time for open-chain systems.
- Variational Integration: The engine uses a midpoint integration scheme that natively handles quaternions and ensures strong energy and momentum conservation.
- Nonlinear Complementarity Problem (NCP): Contact and friction are modeled as an NCP with exact second-order cone constraints. This avoids the "velocity drift" artifacts seen in simulators that use linearized (pyramidal) friction cone approximations.
- Custom Primal-Dual Interior-Point Solver: The core of Dojo is a specialized solver designed to handle the NCP. It adaptively drives complementarity violations to zero to simulate "hard" contact.
- Implicit Differentiation: Instead of backpropagating through the solver's internal iterations (which is numerically unstable), Dojo applies the Implicit Function Theorem to the solver's optimality conditions. This provides stable, analytic gradients with respect to states, actions, and parameters.
Datasets and Benchmarks
The authors evaluated Dojo across a variety of standard robotic models and tasks:
- Robot Models: Atlas humanoid, Unitree A1 quadruped, Franka Panda arm, and Skydio X2 drone.
- Baselines: Benchmarked against MuJoCo, Drake, PyBullet, and Brax.
- Hardware Validation: Real-world box-pushing experiments using a Ufactory xArm 6 to measure the sim-to-real gap.
- System ID: A dataset of real-world trajectories of a thrown box was used to learn physical parameters like friction and geometry.
Key Insights and Ideas
- The "Smoothing Knob": Dojo introduces the central path parameter ($\kappa$) as a user-tunable design parameter. A high $\kappa$ provides a "force-from-a-distance" effect, resulting in smooth gradients that are highly informative for optimization. A low $\kappa$ yields precise, "hard" contact for final simulation rollouts.
- Stability at Low Frequencies: Because of its robust solver, Dojo remains stable at sample rates as low as 20 Hz, whereas other engines might require 500 Hz or more for the same task. This drastically reduces the number of steps needed for differentiation, mitigating gradient explosion.
- Geometric Fidelity: By using exact nonlinear friction cones, Dojo eliminates the unphysical lateral drift common in engines that use pyramidal approximations.
Key Results
- Contact Precision: In an Atlas drop test, Dojo maintained floor penetration constraints to machine precision ($10^{-12}$ mm), while MuJoCo exhibited significant penetration (up to 46 mm) at similar time steps.
- Optimization Efficiency: In policy optimization tasks (e.g., for the Half-Cheetah and Ant environments), Dojo’s implicit gradients were 5 to 10 times more sample-efficient than gradient-free methods like Augmented Random Search (ARS).
- Sim-to-Real Accuracy: In hardware experiments, the positional discrepancy between Dojo’s simulation and the real xArm 6 robot arm averaged only 0.5 cm (1.25%).
- Computational Speed: While MuJoCo remains the fastest per-step, Dojo significantly outperforms other differentiable simulators like Brax and provides comparable performance to Drake, especially when accounting for the lower sample rates Dojo can tolerate.
Limitations and Future Work
- Computational Overhead: Solving a full NCP per time step is more computationally expensive than the "soft" contact models used in MuJoCo. The authors argue this is a trade-off for accuracy and fewer total time steps.
- Local Minima: The underlying optimization problem is non-convex, meaning the solver could theoretically get stuck in local minima, though the authors did not find this to be a major issue in practice.
- Collision Primitives: The current implementation is limited to simple shapes (points, spheres, capsules). Future work aims to support complex meshes and curved surfaces.
- Hardware Acceleration: The engine currently runs on CPUs; porting the solver to GPUs would significantly increase throughput for large-scale RL.
Summary updated