Add MjcEqualityAPI as a base class for MuJoCo constraints and MjcEqualityWeldAPI for representing weld constraints.

This change introduces two new USD API schema:
* MjcEqualityAPI - base API for representing MuJoCo equality constraints in USD, this will typically be applied to joints such as UsdPhysicsFixedJoint.
* MjcEqualityWeldAPI - extends MjcEqualityAPI for MuJoCo's weld equality constraints with an attribute for torqueScale.

The usd_decoder is updated to parse UsdPhysicsFixedJoints and convert the new schema attributes into the appropriate mjsEquality data fields.

PiperOrigin-RevId: 856723634
Change-Id: I0982fd3168b643f8e91d87bb5ae5933e526b63a1
This commit is contained in:
Sam Haves
2026-01-15 10:43:29 -08:00
committed by Copybara-Service
parent d86acd7e12
commit c08e1d9e6e
14 changed files with 1004 additions and 12 deletions
@@ -550,6 +550,34 @@ class "MjcMaterialAPI" (
)
}
class "MjcEqualityAPI" (
doc = "Base API for equality constraints."
)
{
uniform double[] mjc:solimp = [0.9, 0.95, 0.001, 0.5, 2] (
displayName = "SolImp"
doc = "Constraint solver parameter for equality constraint simulation."
)
uniform double[] mjc:solref = [0.02, 1] (
displayName = "SolRef"
doc = "Constraint solver parameter for equality constraint simulation."
)
rel mjc:target (
doc = "Secondary target of the equality constraint."
)
}
class "MjcEqualityWeldAPI" (
apiSchemas = ["MjcEqualityAPI"]
doc = "API providing extension attributes to represent equality/weld constraints."
)
{
uniform float mjc:torqueScale = 1 (
displayName = "Torque Scale"
doc = "A constant that scales the angular residual (angular constraint violation). Notionally in units of torque/force = length. Intuitively this coefficient defines how much the weld “cares” about rotational displacements vs. translational displacements."
)
}
class MjcTendon "MjcTendon" (
doc = "Type describing fixed and spatial tendons."
)