Technology May 03, 2026 · 1 min read

Convert URDF to MuJoCo MJCF Without Installing Anything API + Python SDK

The Problem (3 paragraphs) MuJoCo is the fastest-growing robotics simulator Converting URDF to MJCF is painful (./compile is buggy, urdf2mjcf ignores off-diagonal inertia, mesh paths break) You just want to convert and start training your RL agent The Solution (show curl + Python code) curl -...

DE
DEV Community
by Ravindhar
Convert URDF to MuJoCo MJCF Without Installing Anything API + Python SDK
  1. The Problem (3 paragraphs)

    • MuJoCo is the fastest-growing robotics simulator
    • Converting URDF to MJCF is painful (./compile is buggy, urdf2mjcf ignores off-diagonal inertia, mesh paths break)
    • You just want to convert and start training your RL agent
  2. The Solution (show curl + Python code)
    curl -X POST .../api/urdf/convert-format?target=mjcf \
    -H "X-Api-Key: rk_..." -F "file=@robot.urdf"

import roboinfra
client = roboinfra.Client("rk_...")
result = client.urdf.convert_format("robot.urdf", "mjcf")
with open("robot.xml", "w") as f:
f.write(result.converted_xml)

  1. Real Example (use your preview_test_arm.urdf)

    • Show the input URDF (6 links, 5 joints)
    • Show the output MJCF (with actuators, floor, lighting)
    • "This would take 2-3 hours manually. API did it in 200ms."
  2. Also Converts to Gazebo SDF

    • Same API, just change target=sdf
    • Show the SDF output
  3. Bonus: Validate + Convert in CI

    • GitHub Action YAML (6 lines)
    • Validate URDF + convert to MJCF on every push
  4. Free 14-day Pro trial, no credit card
    Link: https://roboinfra-dashboard.azurewebsites.net

DE
Source

This article was originally published by DEV Community and written by Ravindhar.

Read original article on DEV Community
Back to Discover

Reading List