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
+10
View File
@@ -212,6 +212,16 @@ std::unique_ptr<Node> BuildKinematicTree(const pxr::UsdStageRefPtr stage) {
return nullptr;
}
// If we encounter a joint that does not participate in articulation, we
// should treat it as a constraint instead.
// For example, a weld constraint is represented by a fixed joint.
bool excluded_from_articulation;
joint.GetExcludeFromArticulationAttr().Get(&excluded_from_articulation);
if (excluded_from_articulation) {
extraction.nodes[to_idx]->constraints.push_back(joint.GetPath());
continue;
}
children[from_idx][to_idx] = true;
parent_joints[to_idx].push_back(joint.GetPath());
// Now that we know all the bodies, we can assign joints to respective