Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco USD Mujoco To USD

From Leeroopedia
Knowledge Sources
Domains USD, Model Conversion
Last Updated 2026-02-15 04:00 GMT

Overview

Converts a complete MuJoCo model (mjSpec) into a USD stage, mapping bodies, geoms, joints, actuators, tendons, lights, materials, and global options to their USD equivalents.

Description

mujoco_to_usd.cc is the core conversion engine that transforms MuJoCo model specifications into Universal Scene Description representations. The file imports extensively from both the Pixar USD SDK (SdfPath, UsdGeom, UsdPhysics, UsdShade, UsdLux) and the MjcPhysics custom schema library. It maps MuJoCo's body hierarchy to USD prim paths, converts joints to USD physics joint types (revolute, prismatic, spherical, fixed), translates geoms to USD geometry with materials, and applies MjcPhysics API schemas for MuJoCo-specific parameters. A kWorldIndex constant identifies the world body, and private TfToken definitions provide additional conversion-specific tokens.

Usage

Called by the MJCF file format plugin when USD requests to open a .xml MuJoCo model file, or directly by applications that need to export MuJoCo models to USD format. The conversion produces a fully populated USD stage suitable for rendering in USD-compatible viewers or further processing in USD pipelines.

Code Reference

Source Location

Key Functions

// Full MuJoCo-to-USD conversion pipeline
// Maps bodies, geoms, joints, actuators, tendons, lights, materials
// Uses: UsdPhysics::RevoluteJoint, PrismaticJoint, SphericalJoint, FixedJoint
// Applies: MjcPhysicsSceneAPI, MjcPhysicsJointAPI, MjcPhysicsActuator, MjcPhysicsTendon
static constexpr int kWorldIndex = 0;

Import

#include "mjcf/mujoco_to_usd.h"

I/O Contract

Inputs

Name Type Required Description
mjSpec mjSpec* Yes MuJoCo model specification to convert
mjModel mjModel* Yes Compiled MuJoCo model for runtime data

Outputs

Name Type Description
USD Stage UsdStageRefPtr Fully populated USD stage with MuJoCo model hierarchy, physics, materials, and lights

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment