Skip to content

degree/radian errors converting PhysX drives to MuJoCo actuators #842

Done

Description

@fermarc98

Reported by the urdf-usd-bridge project. Every claim below is either reproduced on the stated build or explicitly marked as a source reading that was not observed running.

Component: isaacsim.asset.importer.utils,
urdf_to_mjc_physx_conversion_utils.py
Affected: Isaac Sim 6.1.0 (present in 6.1.0-rc.26).
Severity: 2a is reachable today via override_joint_stiffness /
override_joint_damping, which is the documented workaround for Issue 1 — so
the workaround produces a correct PhysX drive and a 57.3x-too-soft MuJoCo
actuator from the same import. It is reproduced below. 2b is latent and is a
source reading that was not reproduced
— see its own status note. Both become
live for the default path as soon as Issue 1 is fixed.

Summary

Two values are copied from UsdPhysics attributes into MJC attributes without
the unit conversion the two conventions require. Each is wrong by a factor of
180/pi = 57.29577951.

2a — actuator gains

create_mjc_actuator_from_physics(), lines 279–287:

stiffness = drive_api.GetStiffnessAttr().Get() ...
damping   = drive_api.GetDampingAttr().Get() ...

if stiffness > 0 and damping > 0:
    gain_prm = [stiffness, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    bias_prm = [0, -stiffness, -damping, 0, 0, 0, 0, 0, 0, 0]

UsdPhysics declares a rotational drive's stiffness as
mass*DIST*DIST/degrees/second/second and its damping as
mass*DIST*DIST/second/degrees — both per degree. Isaac's own
asset_utils._set_stiffness_on_joints applies value * math.pi / 180.0 when
writing them, and gain_tuner_drive_math.stored_gain_scale documents the same
scale.

mjc:gainPrm and mjc:biasPrm mirror MJCF gainprm/biasprm, which are in
MuJoCo's native units — per radian for a hinge joint. mujoco-usd-converter
makes the distinction explicit in the opposite direction: it writes MuJoCo's
value unscaled to mjc:damping (joint.py:83) and multiplies by pi/180 for
newton:damping (joint.py:97,108).

So a drive tuned correctly for PhysX becomes 57.3x too soft in MuJoCo.

2b — actuator reference position (source reading only — NOT reproduced)

This sub-issue is a reading of the source. It was not observed on a
running Isaac Sim, for the reason given below. File it as such, or split it
out and drop it if the maintainers would rather see only reproduced defects.

convert_physx_to_mjc(), line 337:

joint.CreateAttribute("mjc:ref", Sdf.ValueTypeNames.Float).Set(target_position)

drive:*:physics:targetPosition is in degrees for a rotational drive;
mjc:ref is MJCF's ref, in radians. A 90 degree target becomes 90 radians.

Note also that mjc:ref and mjc:forceRange:* are created here as Float,
while the MJC schema declares them uniform double
(omni.usd.schema.mujoco generatedSchema.usda). That is cosmetic next to the
unit error, but it is the same line.

Reproduce

Import the URDF from Issue 1 with explicit gains, then compare the two
representations of the same gain:

asset = URDFImporter(URDFImporterConfig(
    urdf_path="damping_demo.urdf", usd_path="/tmp/out",
    joint_drive_type="force", joint_target_type="position",
    override_joint_stiffness=800.0, override_joint_damping=40.0,
)).import_urdf()

stage = Usd.Stage.Open(asset, Usd.Stage.LoadAll)
vset = stage.GetDefaultPrim().GetVariantSets().GetVariantSet("Physics")

vset.SetVariantSelection("physx")
drive = UsdPhysics.DriveAPI(
    stage.GetPrimAtPath("/damping_demo/Physics/shoulder_joint"), "angular")
stored = drive.GetStiffnessAttr().Get()          # per degree

vset.SetVariantSelection("mujoco")
actuator = stage.GetPrimAtPath("/damping_demo/Physics/shoulder_joint_actuator")
gain = actuator.GetAttribute("mjc:gainPrm").Get()[0]   # per radian

print(stored, gain, gain / stored)

Expected

gain / stored == 180/pi ≈ 57.2958, because the same physical gain is being
expressed in two conventions.

Actual — confirmed at runtime on 6.1.0-rc.26

physx   drive:angular:physics:stiffness = 13.962634    (= 800 * pi/180, correct)
physx   drive:angular:physics:damping   =  0.698132    (=  40 * pi/180, correct)
mujoco  mjc:gainPrm                     = [13.962634, 0, 0, ...]
mujoco  mjc:biasPrm                     = [0, -13.962634, -0.698132, ...]

ratio gain / stored = 1.000000     (expected 57.295780)

The user asked for stiffness = 800 N*m/rad. apply_joint_drives converts that
to USD's per-degree convention correctly. create_mjc_actuator_from_physics
then copies the per-degree number into the per-radian MJCF slot, so MuJoCo is
told the gain is 13.96 N*m/rad — 57.3x softer than requested.

2b status: source reading, not reproduced

The mjc:ref defect was not reproduced in the run above.
convert_physx_to_mjc guards the write with if target_position:, and the
default target is 0.0, which is falsy — so the line never executes in the
runs performed here. A non-zero urdf:calibration:reference_position, or any
caller setting a non-zero drive target before the MJC pass, would exercise it.

To be explicit about the evidence for each part of this report:

Claim Status
2a — actuator gains copied per-degree into a per-radian slot Reproduced on 6.1.0-rc.26; measured ratio 1.000000 where 57.295780 was expected
2b — mjc:ref written in degrees into a radian attribute Source reading only. Not executed, not observed

Suggested fix

In create_mjc_actuator_from_physics, scale by 180/pi for rotational joints
before writing gain_prm/bias_prm, and leave prismatic joints unscaled. In
convert_physx_to_mjc, apply math.radians() to target_position before
writing mjc:ref. A regression test asserting the 180/pi ratio between the
two representations would pin both, and would not pass with either defect
present.

Activity

  1. michaellin6 commented on Sep 22, 2026

    @michaellin6

    Confirmed both angular unit-conversion defects.

    I reproduced 2a in the official 6.1.0 and 6.0.1 containers. With requested stiffness/damping of 800/40, PhysX correctly stores 13.962634/0.698132 in its per-degree convention. The MuJoCo variant copies those values unchanged into mjc:gainPrm and mjc:biasPrm, giving a ratio of 1.0 instead of 180/pi. MuJoCo therefore receives gains that are 57.2958x too small. This behavior predates 6.1.

    I also exercised 2b directly through the shipped convert_physx_to_mjc() routine with a nonzero angular target. A PhysX target of 90.0 degrees produces mjc:ref = 90.0; the expected value is pi/2 radians. That promotes the unit issue from source-only to runtime-confirmed, although it is not reached by the default zero-target import path.

    One correction: the reported Float-versus-double mismatch does not reproduce when MjcJointAPI is applied as in the production conversion path. mjc:ref resolves as double; the confirmed problem is the missing angular unit conversion.

    The fix should scale only rotational gains by 180/pi, convert rotational target positions with math.radians(), leave prismatic values unchanged, and update the existing tests that currently assert the unscaled values. We’ll file an internal bug with the 6.0.1/6.1 runtime evidence and track the fix there.

  2. michaellin6 commented on Oct 6, 2026

    @michaellin6

    internal ticket: 6824205

  3. added
    bug
    on Oct 6, 2026
  4. michaellin6 commented on Dec 1, 2026

    @michaellin6

    Hi @fermarc98, the degree/radian conversion issue has been fixed internally. The fix will ship with Isaac Sim 7. We don't have a release date to share yet. Thanks again for the detailed report.

  5. added theissue type on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions