Angular Drive Gains in OpenUSD: Degrees in the File, Radians in the Controller (The 57.3x Trap)
A valid URDF and controller configuration can produce USD with correct joint names, plausible limits and the wrong drive response. Consider an exporter that converts angular targets from radians to degrees, then copies controller stiffness and damping unchanged. Every attribute can parse successfully. Yet the exported force drive is approximately 57.3 times too stiff, and its damping coefficient is wrong by the same factor.
The attempted repair can create the opposite failure. An engineer learns that USD needs gains multiplied by π/180, applies that conversion upstream, then supplies the result to an Isaac Lab configuration whose writer already performs it. The resulting drive is approximately 57.3 times too weak. Both failures come from losing track of which interface owns the conversion.
This article covers force-type angular drives on stages with metersPerUnit=1.0 and kilogramsPerUnit=1.0. Those are stage unit scales, not restrictions requiring every link to weigh one kilogram. The result is an algebraic torque invariant; it does not establish identical trajectories across implicit solvers. Acceleration drives require a separately specified adapter.
1. Targets and gains convert in opposite directions
Raw UsdPhysicsDriveAPI uses degrees for angular position and degrees per second for angular velocity. On the stated stage, angular stiffness is N·m/deg, damping is N·m·s/deg, and maxForce is a torque limit in N·m. The schema therefore requires the following boundary contract. (openusd.org)
| Quantity | Controller units | Raw USD units | SI → raw USD | Conversion owner |
|---|---|---|---|---|
targetPosition |
rad | deg | ×180/π | Documented target writer |
targetVelocity |
rad/s | deg/s | ×180/π | Documented target writer |
stiffness |
N·m/rad | N·m/deg | ×π/180 | Direct USD writer, or Isaac Lab writer |
damping |
N·m·s/rad | N·m·s/deg | ×π/180 | Direct USD writer, or Isaac Lab writer |
maxForce |
N·m | N·m | ×1 | Preserve the torque budget |
The direction follows from the denominator. Expressing one angular displacement in degrees increases its numerical value; preserving torque requires decreasing the coefficient multiplying it. A torque limit contains no angular denominator, so it receives no degree/radian factor.
For a concrete, versioned Isaac Lab example, v2.1.0 JointDrivePropertiesCfg accepts angular stiffness and damping in SI. Its modify_joint_drive_properties() writer multiplies both by math.pi / 180.0 when authoring the angular USD drive. Supply stiffness=100 and damping=10 to that configuration for the controller used below. Its max_effort maps to USD maxForce without angular rescaling. (github.com, github.com)
That configuration does not contain target-position or target-velocity fields. Its max_velocity is a velocity limit, not targetVelocity. Audit the target-writing API separately, and pin the implementation used by your exporter; the Isaac Lab name alone does not identify a unit contract. (github.com, github.com)
Treat the unit convention as part of the interface type. A configuration field named stiffness is incomplete documentation unless its angular denominator is stated. Record whether a value is still in controller SI units or is ready for a raw USD setter. Make that decision at one named boundary, rather than allowing every importer, asset wrapper and calibration script to apply its own precautionary conversion.
MuJoCo requires the same attention to boundaries. Its compiled mjModel and mjData use radians for angular quantities, even when MJCF source angles use degrees. Actuator gearing changes the relationship between actuator coordinates and joint effort. Establish joint-space SI gains before applying this USD conversion; an arbitrary actuator kp is not automatically a joint stiffness. (mujoco.readthedocs.io, mujoco.readthedocs.io)
2. The torque invariant
For one scalar angular coordinate, define position and velocity errors using the same axis, sign, zero and angle branch:
$$ e=q_{\mathrm{target}}-q,\qquad \dot e=v_{\mathrm{target}}-v. $$
The unsaturated SI proportional–derivative torque is
$$ \tau_{\mathrm{SI}}=K_{\mathrm{SI}}e+D_{\mathrm{SI}}\dot e. $$
Let $c=180/\pi$. Both the target and measured coordinate must describe the same physical angle, so $e_{\mathrm{USD}}=ce$ and $\dot e_{\mathrm{USD}}=c\dot e$. Choose
$$ q_{\mathrm{USD}}=cq_{\mathrm{SI}},\quad v_{\mathrm{USD}}=cv_{\mathrm{SI}},\quad K_{\mathrm{USD}}=K_{\mathrm{SI}}/c,\quad D_{\mathrm{USD}}=D_{\mathrm{SI}}/c. $$
Substitution gives the complete proof:
$$ \tau_{\mathrm{USD}} =\frac{K_{\mathrm{SI}}}{c}(ce) +\frac{D_{\mathrm{SI}}}{c}(c\dot e) =K_{\mathrm{SI}}e+D_{\mathrm{SI}}\dot e =\tau_{\mathrm{SI}}. $$
With the same torque limit $T$, applying the same algebraic clamp, $\operatorname{clip}(\tau,-T,T)$, also preserves equality. No time step or inertia appears in this identity because it compares the force law at a fixed state. It does not integrate that state forward.
Copying SI gains directly into degree-based attributes instead produces $\tau_{\mathrm{copied}}=c\tau_{\mathrm{SI}}$. Converting gains twice produces $\tau_{\mathrm{double}}=\tau_{\mathrm{SI}}/c$. These ratios assume both gains suffer the same error and both calculations use the same physical position and velocity errors. An additional target-unit error is a different fault and can obscure this signature.
3. A 12.0 N·m probe
Use $K_{\mathrm{SI}}=100\ \mathrm{N,m/rad}$, $D_{\mathrm{SI}}=10\ \mathrm{N,m,s/rad}$, $e=0.1\ \mathrm{rad}$, and $\dot e=0.2\ \mathrm{rad/s}$. One explicit fixture has measured position and velocity zero, with those two errors supplied as the targets.
$$ \tau=100(0.1)+10(0.2)=12.0\ \mathrm{N,m}. $$
Correct conversion yields K_USD=1.74532925, D_USD=0.17453293, position error 5.72957795 degrees and velocity error 11.45915590 degrees per second. These displayed decimals are rounded; calculations must use the formulas and full available precision.
| Authored raw USD case | Stiffness, N·m/deg | Damping, N·m·s/deg | Unsaturated torque, N·m |
|---|---|---|---|
| Correct conversion | 1.74532925 | 0.17453293 | 12.0 |
| SI gains copied verbatim | 100 | 10 | 687.54935416 |
| Gains converted twice | 0.03046174 | 0.00304617 | 0.20943951 |
The exact scale factor is $180/\pi\approx57.2957795131$, not the rounded headline value 57.3. The double-converted drive retains only $\pi/180\approx0.01745329252$ of the intended torque at this state.
For this diagnostic fixture, choose a finite maxForce=1000 N·m so none of the three cases saturates. A production torque limit can hide the ratio: with a 20 N·m cap, the copied-gain calculation clips to 20 rather than displaying 687.55. That cap is a test parameter, not a recommendation for robot hardware.
The equality is exact algebraically. Separate binary64 evaluation paths can return 12.0 and 12.000000000000002; compare with a justified tolerance rather than requiring bitwise identity. Authored USD drive attributes are floats, which introduces another rounding boundary. (openusd.org)
4. A 35-line static gate
A static linter cannot infer intended units from a bare value such as 100. It needs an independent SI reference. Deriving that reference by converting the same suspect USD backwards merely verifies a round trip through your own assumption.
The following pl_std_3_12 checks two records ordered as (targetPosition, targetVelocity, stiffness, damping, maxForce). si contains trusted joint-space SI values; usd contains resolved raw angular-drive values after either writer. An extraction adapter must identify the angular drive, read its actual type and stage scales, and match the joint and sample time. effort_mode="torque" is a validation-contract token, not an OpenUSD attribute.
import math
def pl_std_3_12(si, usd, *, drive_type, effort_mode, units):
"""Angular (q, v, K, D, maxForce); units=(metersPerUnit, kilogramsPerUnit)."""
if drive_type != "force" or effort_mode != "torque":
return ["UNSUPPORTED_DRIVE_OR_EFFORT_MODE"]
records = (si, usd, units)
if any(type(r) not in (tuple, list) for r in records):
return ["INVALID_RECORD"]
if tuple(map(len, records)) != (5, 5, 2):
return ["INVALID_RECORD"]
try:
valid = all(type(x) in (int, float) and math.isfinite(x)
for r in records for x in r)
except OverflowError:
valid = False
if not valid:
return ["NON_FINITE_OR_NON_NUMERIC"]
if tuple(units) != (1.0, 1.0):
return ["UNSUPPORTED_STAGE_UNITS"]
if any(x < 0 for r in (si, usd) for x in r[2:]):
return ["NEGATIVE_GAIN_OR_LIMIT"]
to_deg, to_rad = 180.0 / math.pi, math.pi / 180.0
factors = (to_deg, to_deg, to_rad, to_rad, 1.0)
expected = tuple(x * s for x, s in zip(si, factors))
if not all(map(math.isfinite, expected)):
return ["NON_FINITE_EXPECTATION"]
close = lambda a, b: math.isclose(a, b, rel_tol=1e-6, abs_tol=0.0)
errors = []
for i, (got, want) in enumerate(zip(usd, expected)):
if not close(got, want):
scaled = i < 4 and any(close(got, want * s) for s in (to_deg, to_rad))
code = "RAD_DEG_SCALE_MISMATCH" if scaled else "VALUE_MISMATCH"
errors.append(f"{('q', 'v', 'K', 'D', 'maxForce')[i]}:{code}")
return errors
An empty list means the record passes. For si=(0.1, 0.2, 100, 10, 1000), correctly converted USD passes; copying or double-converting both gains produces K:RAD_DEG_SCALE_MISMATCH and D:RAD_DEG_SCALE_MISMATCH. Other deviations produce VALUE_MISMATCH, so the diagnostic does not label every disagreement a unit error.
The relative tolerance accommodates ordinary float rounding; zero absolute tolerance prevents expected zero from accepting a small nonzero value. The gate rejects malformed records, booleans, non-finite numbers, negative gains or limits, unsupported stage units, and unsupported drive/effort modes. Requiring a finite torque budget is deliberately stricter than OpenUSD, which permits an infinite maxForce. (openusd.org)
Zero gains cannot expose a multiplicative conversion fault. Keep the nonzero 100/10 fixture, and test position and velocity terms independently as well. With the velocity error zero, the stated position error must produce 10 N·m; with the position error zero, the stated velocity error must produce 2 N·m. Reverse both errors and the combined result becomes −12 N·m.
A single summed-torque check is insufficient: the wrong SI pair K=80, D=20 also produces 12 N·m at the original errors. It passes that one observation while changing both slopes of the controller. Comparing individual authored coefficients against intent, as this gate does, prevents that cancellation from becoming a false pass.
This snippet is the numerical core, not a USD traversal utility. Feed it ordinary Python lists or tuples containing built-in numbers, after resolving the relevant attributes. Missing values must fail extraction or reach the gate as invalid values; do not replace them with invented zeroes. Keep the extraction failure in the receipt rather than silently dropping that joint from the validation population.
5. Put the contract in the pipeline
-
Preserve SI intent. Record joint identity, coordinate convention, targets, gains, torque budget and source configuration. Keep this evidence independent of the exported USD. A hash of the source configuration helps bind a lint receipt to a particular controller revision.
-
Convert once at the documented writer. A writer using
UsdPhysicsDriveAPIdirectly must perform the table’s conversion before setting attributes. The pinned Isaac Lab configuration receives SI gains and lets its writer convert them. Record the writer version and conversion owner alongside the export. -
Use π, never 57.3. Compute
180.0 / math.piandmath.pi / 180.0. Rounded constants create a systematic error that can survive ordinary visual inspection and undermine tight regression checks. -
Keep passive damping separate. URDF
<dynamics damping="…">specifies physical joint damping, with rotational units N·m·s/rad. Its coefficient is not automatically the motor’s velocity-feedback gain. (github.com) Passive damping contributes $-b\dot q$; motor damping contributes $D(v_{\mathrm{target}}-\dot q)$. At zero target velocity those terms can look equivalent, but a moving target exposes the distinction. Preserve both meanings and inspect importer mappings for accidental duplication. -
Lint composed values. Check the final drive values intended for the chosen backend, including stronger layer overrides and selected variants. USD resolves attribute values according to composition and the requested time code; inspecting a single layer’s text can miss the effective value. (openusd.org) Retain the SI record, resolved values, stage scales, input hashes and diagnostic codes. A correct intermediate physics layer is insufficient evidence for the assembled asset.
-
Run native dynamics separately. After static acceptance, exercise the asset under a pinned backend, time step, solver configuration, inertia model and torque limit. Check the actual motion and available effort telemetry. Numerical stability depends on these conditions; NVIDIA’s articulation guidance explicitly addresses time steps, solver iterations, competing constraints and drive-force limits. (docs.omniverse.nvidia.com)
If a runtime script replaces the gains after loading, the file receipt no longer describes the active controller. Capture those overrides and their unit contracts separately. Likewise, a backend that implements the PD law externally needs evidence for that controller path. File-level agreement remains useful, but acceptance of a live system must identify which configuration actually governs its motor effort.
Keep the two outcomes separately named in CI: a passing static unit contract and a completed native dynamics test. The first can be deterministic without a simulator installation. The second needs an execution receipt. A missing native run should remain explicitly untested, even when every authored number passes lint.
Acceleration drives need their own documented treatment of gains, inertia and effort limits. Reject them in this force-drive profile rather than silently assigning torque semantics. Likewise, the 57.2958 factor describes the authored gain error and fixed-state unsaturated torque error; it is not a claimed ratio of settling times, accelerations or measured implicit-solver forces.
Use Proofloom Labs’ free Reference Calibration Kit as a starting point for checking your authoring boundary. Apply the same explicit unit contract when evaluating Proofloom’s five-layer OpenUSD SimReady assets, and retain separate native-runtime evidence for each backend.