Implementation:Google deepmind Mujoco USD JointAPI
| Knowledge Sources | |
|---|---|
| Domains | USD, Physics Schema |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Implements the MjcPhysicsJointAPI USD applied API schema for augmenting USD joint prims with MuJoCo-specific joint properties.
Description
jointAPI.cpp provides the USD schema implementation for MjcPhysicsJointAPI, an applied API schema derived from UsdAPISchemaBase that extends standard USD physics joints with MuJoCo-specific attributes. Unlike typed schemas, this API schema is applied to existing prims via Apply() and validated via CanApply(). The file registers the schema with the TfType system, implements the standard USD API schema interface, and provides attribute accessors such as GetGroupAttr() for retrieving MuJoCo joint group properties via MjcPhysicsTokens.
Usage
Applied to USD physics joint prims during MuJoCo-to-USD model export to annotate them with MuJoCo-specific parameters (damping, armature, group, limited range) that do not have direct equivalents in the standard USD physics schema.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/usd/mjcPhysics/jointAPI.cpp
- Lines: 1-315
Key Functions
TF_REGISTRY_FUNCTION(TfType); // Registers MjcPhysicsJointAPI
MjcPhysicsJointAPI::Get(const UsdStagePtr& stage, const SdfPath& path);
bool MjcPhysicsJointAPI::CanApply(const UsdPrim& prim, std::string* whyNot);
MjcPhysicsJointAPI MjcPhysicsJointAPI::Apply(const UsdPrim& prim);
UsdAttribute MjcPhysicsJointAPI::GetGroupAttr() const;
Import
#include <mujoco/experimental/usd/mjcPhysics/jointAPI.h>
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| prim | UsdPrim | Yes | USD prim to which the MjcPhysicsJointAPI is applied |
| stage | UsdStagePtr | No | USD stage for Get operations |
| path | SdfPath | No | USD path for Get operations |
Outputs
| Name | Type | Description |
|---|---|---|
| MjcPhysicsJointAPI | MjcPhysicsJointAPI | Applied API schema instance with MuJoCo joint attributes |
| UsdAttribute | UsdAttribute | Individual attribute accessors (group, damping, armature, etc.) |