URDF character loader for Momentum.
URDF-to-Momentum Frame Convention
URDF and Momentum organize skeletons differently, so this loader has to choose what a Momentum "joint" node means.
URDF convention:
- A URDF joint connects a parent link to a child link.
- The joint contributes the parent-to-child bind-pose transform (<origin>) and the motion axis (<axis>).
- Data attached to the child link — visuals, collisions, inertials, and descendant joint origins — is authored in the child link frame.
Momentum convention:
- Each skeleton node stores a local frame (preRotation + translation offset) plus parameters on fixed local principal axes: rx/ry/rz, tx/ty/tz.
Loader choice: child-link-centric import
- For joints whose axis is already aligned with a Momentum principal axis, the imported Momentum node corresponds to the URDF child link and carries that link's incoming URDF joint.
- preRotation is set to the URDF joint origin rotation only in this direct case, so the imported local frame stays equal to the URDF child link frame.
- For a revolute or continuous joint with an arbitrary axis, the loader inserts an internal axis-aligned helper node followed by a fixed child-link node. The helper carries the single rotation DOF, and the fixed child-link node applies the inverse alignment.
- This keeps child-link-authored data directly compatible with the imported skeleton.
Consequence for DOF mapping:
- DOFs are mapped onto the matching Momentum principal axis inside the preserved link frame. For example, a revolute joint with axis (0,0,1) maps to rz.
- A revolute or continuous joint with a non-principal axis maps its model parameter to the generated helper node's rx parameter. The helper-frame split makes the child link's transform exactly match the URDF transform for finite rotations about that axis.
- The exposed model parameter preserves the URDF joint scalar coordinate. If the URDF axis points along -X, -Y, or -Z, the parameter transform therefore carries a -1 coefficient into the corresponding local Momentum principal axis.
- In other words, under this link-preserving convention the exposed model parameter is not always numerically equal to the local positive-axis rx/ry/rz entry used by Momentum FK. For negative-axis joints, a positive model parameter produces a negative local principal-axis rotation.
- Prismatic joints with arbitrary axes map one model parameter to the parent-frame translation direction implied by the URDF joint origin rotation and axis.
- Planar joints still require a principal-axis plane normal (±X, ±Y, ±Z); a non-principal planar axis is rejected. The arbitrary-axis helper-node split is currently implemented only for revolute and continuous joints.
- Because revolute model parameters stay in URDF joint coordinates and prismatic model parameters keep Momentum's centimeter convention, limits and mimic relations remain in the same coordinate as the imported model parameter.
- We do not leave an extra axis-alignment rotation on the child-link node. Doing so would make the imported local frame differ from the URDF child link frame, and every child-link- authored quantity would need frame conversion.
Units: URDF uses meters; Momentum uses centimeters. All positions are converted automatically.
Definition in file urdf_io.h.