Onshape-to-Robot Guide

onshape-to-robot is a tool that exports a robot designed in Onshape to robot description formats that simulators can load, such as URDF, SDF, and MuJoCo (MJCF).

Overview diagram: a robot designed in Onshape, with an arrow pointing to the same robot exported and loaded in four simulators: URDF in PyBullet, MuJoCo, SDF in Gazebo, and URDF in Meshcat.

From an Onshape design to URDF, SDF, and MuJoCo (image: onshape-to-robot documentation)

Official resources

Example: Berkeley Humanoid Lite

Berkeley Humanoid Lite uses onshape-to-robot to generate its robot description files. Their scripts are a very useful example of how to use onshape-to-robot in practice from a Python program:

Berkeley Humanoid Lite Assets: scripts (GitHub)

Script What it does
export_onshape_to_urdf.py Exports the Onshape CAD model to URDF
export_onshape_to_mjcf.py Exports the Onshape CAD model to MJCF (MuJoCo)
convert_urdf_to_usd.py Converts the URDF to USD

The export scripts run onshape-to-robot with a config.json file that describes the export settings.