RobotForge
Published·~12 min

Drake: the MIT tool nobody uses enough

More than a simulator — a robotics research toolkit with rigorous physics, first-class optimization, and Lagrangian formulations. The tool MIT's Underactuated Robotics course teaches with.

by RobotForge
#simulators#drake#optimization

Drake started as MIT's underactuated-robotics teaching tool. Over the years it grew into a serious robotics research platform: rigorous continuous-time physics, first-class trajectory optimization, integrated motion planning, exact CAD-grade collision detection. Less popular than MuJoCo or Gazebo for hobbyist use; widely used by control-theory researchers and modern startups doing aggressive optimization. Worth knowing.

What Drake is (and isn't)

Drake is a toolkit, not just a simulator. Its core is:

  • Multibody physics: rigid-body dynamics with continuous-time and discrete-time formulations. Hydroelastic contact for soft / mesh-on-mesh contact.
  • Trajectory optimization: built-in MathematicalProgram framework, IPOPT/SNOPT/Gurobi/MOSEK back-ends.
  • Motion planning: PRM, RRT, plus optimization-based planners.
  • Inverse kinematics: optimization-based; handles redundant arms and complex constraints.
  • Visualization: meshcat-based 3D viewer.

It's also a simulator — you can run physics, render scenes, evaluate controllers — but the simulator is one of many tools, not the central product.

Strengths

  • Mathematical rigor: Drake's physics is continuous-time correct. Many simulators integrate naively; Drake handles symplectic integration, RK4 with adaptive stepping, exact gradient computation.
  • Optimization-first: trajectory optimization, MPC, system identification — all wrapped in a unified MathematicalProgram API. Used directly in research papers.
  • Hydroelastic contact: a smooth-pressure contact model that doesn't suffer from MuJoCo's stiffness or Bullet's penetration. Production-grade for tasks involving soft contact (a finger pressing on a table).
  • Sum-of-squares Lyapunov verification: Drake has direct SOS support; you can computationally verify stability for non-trivial controllers. Niche but powerful.
  • MIT-developed: heavy academic use; tutorials and examples are research-grade.

Weaknesses

  • Smaller community: fewer pre-built robots and environments than Isaac/MuJoCo. Active but narrow.
  • Build complexity: traditionally Bazel-based, intimidating to first-timers. Recent Python-only install via pip is much friendlier.
  • Slower for batched RL: not GPU-parallelized. For thousand-env RL training, MuJoCo MJX or Isaac Lab beat Drake.
  • Documentation gaps: docs assume some familiarity with the underlying math. New users hit a learning curve.

The MathematicalProgram pattern

Drake's distinctive feature: optimization is a first-class object.

from pydrake.solvers import MathematicalProgram, Solve

prog = MathematicalProgram()
x = prog.NewContinuousVariables(2, "x")

# Quadratic cost
prog.AddQuadraticCost(x[0]**2 + x[1]**2)

# Linear constraint
prog.AddLinearConstraint(x[0] + x[1] == 1)

result = Solve(prog)
print(result.GetSolution(x))

That's optimization, but the same pattern handles trajectory optimization, IK, motion planning, controller synthesis. Variables can be states; constraints can be dynamics; cost can be tracking error. Powerful unified abstraction.

The simulation pattern

from pydrake.geometry import StartMeshcat
from pydrake.systems.framework import DiagramBuilder
from pydrake.multibody.parsing import Parser
from pydrake.multibody.plant import AddMultibodyPlantSceneGraph
from pydrake.systems.analysis import Simulator

meshcat = StartMeshcat()
builder = DiagramBuilder()
plant, scene_graph = AddMultibodyPlantSceneGraph(builder, time_step=1e-3)
parser = Parser(plant)
parser.AddModels("my_robot.urdf")
plant.Finalize()

# Visualizer
visualizer = MeshcatVisualizer.AddToBuilder(builder, scene_graph, meshcat)

# Build and run
diagram = builder.Build()
simulator = Simulator(diagram)
simulator.Initialize()
simulator.AdvanceTo(10.0)  # 10 seconds

Verbose compared to PyBullet but composable: every component is a System; you wire them together in a Diagram. Inputs and outputs are explicit. Good for building real production stacks.

Where Drake shines

  • Trajectory optimization research: contact-implicit trajectory optimization for legged robots. Drake is the standard.
  • Manipulation with hydroelastic contact: pressing fingers on tables, peg-in-hole with friction. Cleaner than MuJoCo for these.
  • Provable controller synthesis: SOS Lyapunov verification, robust MPC with provable bounds.
  • Teaching: MIT 6.832 (Underactuated Robotics) is taught entirely in Drake. The tutorials are excellent.
  • Bimanual manipulation research: Toyota Research Institute uses Drake heavily.

Where it's the wrong tool

  • Massive parallel RL: use MuJoCo MJX or Isaac Lab.
  • ROS-native robotics work: use Gazebo.
  • Quick prototypes: PyBullet's API is simpler.
  • Photorealistic vision: Isaac wins.

The 2026 production reality

Drake has a small but devoted user base:

  • MIT and Harvard robotics labs.
  • Toyota Research Institute (Nikolaus Correll's manipulation group).
  • Several startups doing optimization-heavy autonomy (Boston Dynamics' algorithm group reportedly uses it for some research).
  • Stanford and CMU control-theory courses.

You'll meet Drake when reading optimization-based robotics papers. It's worth knowing the API even if your daily work uses other simulators.

Getting started

Modern install (post-2023): pip install drake. Yes, a single pip install. Linux, macOS, Windows-via-WSL.

Then:

git clone https://github.com/RussTedrake/underactuated
cd underactuated
pip install -r requirements.txt
jupyter notebook

Russ Tedrake's notebooks are the canonical introduction. Work through them; the math is rigorous, the code is readable, the underlying tool is powerful.

Common gotchas

  • Time-step choice: Drake's continuous-time formulation can use small variable steps. For real-time, use time_step=1e-3 for 1 kHz sim.
  • Hydroelastic contact tuning: needs material properties (Young's modulus). Default values often need adjustment per scene.
  • Bazel legacy: older tutorials reference Bazel builds. The pip install is easier; use it.
  • API verbosity: setting up a basic sim takes more lines than PyBullet. Worth it for production stacks.

Exercise

Install Drake. Work through the cart-pole swing-up example from MIT 6.832. Implement trajectory optimization (direct collocation) using MathematicalProgram. Compare to a CasADi/IPOPT version. The Drake API is verbose but powerful — and once you've solved one optimization problem with it, the rest are template-able.

Next

Webots — the simulator that doesn't try to be cutting-edge but excels at one thing: cross-platform classroom use.

Comments

    Sign in to post a comment.