Make sure MuJoCo is installed (
pip install mujoco) and you’ve completed the Quickstart basics.The prompt
- Authors an MJCF scene with a chassis, 4 wheels (correct cylinder axis vs hinge axis), an IMU site, sensors, actuators, and the floor + obstacles
- Picks chassis-z so the wheel bottoms rest exactly at z=0 (no spawn-bounce)
- Picks damping / armature / friction values that won’t oscillate when commands drop to zero
- Validates the MJCF (loads the model, asserts
nbody/njnt/nu/nsensor, checks for NaN inqacc) - Writes a
run_sim.pyheadless loop with the requested controls and CSV logging - Runs the sim, prints the final chassis pose and contact count
- (Optional) opens the MuJoCo passive viewer afterwards
What you get on disk
After the prompt completes, your workspace looks like:robot_scene.xml and you’ll find the MJCF clean and well-named:
joint1, body3, geom_2. Real names you can grep.
Iterating on the scene
Each follow-up triggers only what’s needed:Opening the viewer
For interactive inspection:/ps to see it running. Press q in the viewer window (or /exit in Drift) when you’re done — Drift cleans up the process.
Debugging common MuJoCo failures
Describe the symptom, Drift figures it out:condim=1 is frictionless; need condim=3 or 6), chassis-wheel embedding.
damping/armature until the stop is clean.
Cost-tracking note
Long multi-step builds (write MJCF → validate → fix → run → tune → repeat) are exactly what Drift’s caching and planning are optimized for. The agent keeps context across steps, so you’re paying input cost on incremental changes — not the full prompt re-paid on every call.Mixing MuJoCo and ROS2
You can use MuJoCo without ROS2 in the loop — most users do. But if you want a ROS2 bridge forcmd_vel / odometry / sensor topics, Drift can scaffold that:
ros2 launch it like any other node.
Next steps
Your First Simulation (Gazebo)
The Gazebo / ROS2-first path for comparison
Manipulator in RViz
A single-prompt build of a 3-joint manipulator
Project Context
Capture MuJoCo conventions for your team in DRIFT.md
Custom Skills
Write your team’s MJCF practices as a skill