#8165·IsaacLab

[Bug Report] Newton: MJCF actuators that Newton keeps as `CTRL_DIRECT` stay active under Isaac Lab actuators on `physics_variant="mujoco"` assets

Author: NeoZngCreated Sep 29, 2026Updated Sep 30, 2026
Labelsbug

Describe the bug

An MJCF asset converted with physics_variant="mujoco" composes its MjcActuator prims, and Newton imports them. Newton turns plain PD position/velocity rows into joint targets, which Isaac Lab's actuators then own, but keeps every other row (gear != 1, dampratio, timeconst filters, other gain/bias types) as a native MuJoCo actuator driven only by control.mujoco.ctrl (CTRL_DIRECT, Newton's documented contract). Isaac Lab adds its own actuator on the same DOFs (_configure_joint_target_modes) and never commands that ctrl: its only mujoco.ctrl writer, the fixed-tendon adapter (mjwarp_tendon_control.py), fills tendon-actuator columns and writes 0 to all others. At ctrl = 0 a position-shaped row is a hidden spring toward q = 0 (joint stiffness gear²·kp, damping gear²·kv), so targets are missed, and neither Isaac Lab nor Newton warns about the overlap.

ImplicitActuatorCfg(stiffness=200, damping=10), target 0.5 rad, joint position after 1 s:

Joint MJCF actuator mujoco variant physics variant
j_gear <position kp="50" kv="2" gear="2"/> 0.2500 (= 200·0.5 / (200 + 2²·50)) 0.5000
j_dampratio <position kp="100" dampratio="1"/> 0.3333 (= 200·0.5 / (200 + 100)) 0.5000

IdealPDActuatorCfg gives the same values. With the MJWarpSolverCfg default integrator="euler", the extra explicit damping makes j_gear unstable (312.6 rad after 1 s; the physics variant stays at 0.5000). Removing the MJCF <actuator> block, or using the physics variant, reaches 0.5000. Isaac Lab pairs this variant with Newton: SHADOW_HAND_NEWTON_CFG and the Franka soft-lift scene (#7847) select {"Physics": "mujoco"} on Newton, and the converter docstring says to select it "to author an asset for a specific backend" (AssetConverterBaseCfg.physics_variant). Those two assets author only plain PD joint rows, so they are unaffected; an MJCF with any of the rows above is not. For example, all 29 actuators of MuJoCo Menagerie's unitree_g1/g1.xml are <position kp="500" dampratio="1">.

Steps to reproduce

./isaaclab.sh -p repro_mujoco_variant_actuators.py --physics_variant mujoco (bug) and --physics_variant physics (control) on Isaac Lab develop. Tested with the Isaac Sim (Kit) MJCF importer; the standalone importer wheel was not tried.

repro_mujoco_variant_actuators.py
python
"""Newton + ``physics_variant="mujoco"``: MJCF actuators kept as CTRL_DIRECT act underneath Isaac Lab actuators.

    python repro_mujoco_variant_actuators.py --physics_variant mujoco    # bug
    python repro_mujoco_variant_actuators.py --physics_variant physics   # control
"""

import argparse
import os
import tempfile

parser = argparse.ArgumentParser()
parser.add_argument("--physics_variant", default="mujoco", choices=["mujoco", "physics"])
parser.add_argument("--integrator", default="implicitfast")
args = parser.parse_args()

# Fixed base with two vertical hinges (no gravity torque about the axes). Each MJCF actuator uses a
# feature Newton cannot express as a joint target: gear != 1, and dampratio.
MJCF = """<mujoco model="ctrl_direct_repro">
  <worldbody>
    <body name="base">
      <geom type="box" size="0.05 0.05 0.05"/>
      <body name="link_gear" pos="0 0.3 0">
        <joint name="j_gear" axis="0 0 1"/>
        <inertial pos="0.1 0 0" mass="1" diaginertia="0.03 0.03 0.03"/>
        <geom type="box" size="0.1 0.02 0.02" pos="0.1 0 0"/>
      </body>
      <body name="link_dampratio" pos="0 -0.3 0">
        <joint name="j_dampratio" axis="0 0 1"/>
        <inertial pos="0.1 0 0" mass="1" diaginertia="0.03 0.03 0.03"/>
        <geom type="box" size="0.1 0.02 0.02" pos="0.1 0 0"/>
      </body>
    </body>
  </worldbody>
  <actuator>
    <position name="a_gear" joint="j_gear" kp="50" kv="2" gear="2"/>
    <position name="a_dampratio" joint="j_dampratio" kp="100" dampratio="1"/>
  </actuator>
</mujoco>
"""
xml_path = os.path.join(tempfile.mkdtemp(), "ctrl_direct_repro.xml")
with open(xml_path, "w") as f:
    f.write(MJCF)

from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg  # noqa: E402

from isaaclab.app import launch_simulation  # noqa: E402
from isaaclab.sim import SimulationCfg  # noqa: E402
from isaaclab.utils.version import standalone_importers_available  # noqa: E402

sim_cfg = SimulationCfg(
    dt=0.005,
    device="cuda:0",
    physics=NewtonCfg(solver_cfg=MJWarpSolverCfg(integrator=args.integrator), use_cuda_graph=False),
)
# The MJCF importer needs Kit unless the standalone importer wheel is installed.
with launch_simulation(sim_cfg, {"headless": True, "require_kit": not standalone_importers_available()}):
    import isaaclab_newton
    import mujoco
    import newton
    import torch
    from isaaclab_newton.physics import NewtonManager
    from newton.solvers import SolverMuJoCo

    import isaaclab
    import isaaclab.sim as sim_utils
    from isaaclab.actuators import ImplicitActuatorCfg
    from isaaclab.assets import ArticulationCfg
    from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
    from isaaclab.utils.configclass import configclass

    @configclass
    class SceneCfg(InteractiveSceneCfg):
        robot = ArticulationCfg(
            prim_path="{ENV_REGEX_NS}/Robot",
            spawn=sim_utils.MjcfFileCfg(asset_path=xml_path, fix_base=True, physics_variant=args.physics_variant),
            actuators={"arm": ImplicitActuatorCfg(joint_names_expr=[".*"], stiffness=200.0, damping=10.0)},
        )

    sim = sim_utils.SimulationContext(sim_cfg)
    scene = InteractiveScene(SceneCfg(num_envs=1, env_spacing=2.0))
    robot = scene["robot"]
    sim.reset()

    target = torch.full((1, robot.num_joints), 0.5, device=sim.device)
    for _ in range(200):  # 1 s
        robot.actuators.target_command.set_position_index(value=target)
        robot.write_data_to_sim()
        sim.step()
        robot.update(sim.get_physics_dt())

    print(f"isaaclab        {isaaclab.__file__}\nisaaclab_newton {isaaclab_newton.__file__}")
    print(f"newton {newton.__version__}, physics_variant={args.physics_variant!r}, integrator={args.integrator!r}")
    for name, q in zip(robot.joint_names, robot.data.joint_pos.torch[0].tolist()):
        print(f"  {name:12s} target 0.5000  q(t=1 s) {q:.4f}")

    # MuJoCo actuators on the MJWarp model: Isaac Lab's PD pairs (JOINT_TARGET) plus the imported CTRL_DIRECT rows.
    solver = NewtonManager._solver
    mjm = solver.mj_model
    sources = solver.mjc_actuator_ctrl_source.numpy() if mjm.nu else []
    print(f"MuJoCo actuators: nu = {mjm.nu}")
    for a in range(mjm.nu):
        mj_joint = mujoco.mj_id2name(mjm, mujoco.mjtObj.mjOBJ_JOINT, int(mjm.actuator_trnid[a, 0]))
        joint = next(n for n in robot.joint_names if mj_joint.endswith(n))
        print(
            f"  {a}  {joint:12s} {SolverMuJoCo.CtrlSource(int(sources[a])).name:12s}"
            f" gainprm[0] {mjm.actuator_gainprm[a, 0]:6.1f}  biasprm[:3] {mjm.actuator_biasprm[a, :3].round(3).tolist()}"
            f"  gear {mjm.actuator_gear[a, 0]:.0f}"
        )
    mujoco_control = getattr(NewtonManager.get_control(), "mujoco", None)
    if mujoco_control is not None:
        print(f"control.mujoco.ctrl = {mujoco_control.ctrl.numpy().tolist()}")

Output (path lines trimmed; the third run prints the same actuator table as the first):

$ python repro_mujoco_variant_actuators.py --physics_variant mujoco
newton 1.6.0, physics_variant='mujoco', integrator='implicitfast'
  j_dampratio  target 0.5000  q(t=1 s) 0.3333
  j_gear       target 0.5000  q(t=1 s) 0.2500
MuJoCo actuators: nu = 6
  0  j_dampratio  JOINT_TARGET gainprm[0]  200.0  biasprm[:3] [0.0, -200.0, 0.0]  gear 1
  1  j_dampratio  JOINT_TARGET gainprm[0]   10.0  biasprm[:3] [0.0, 0.0, -10.0]  gear 1
  2  j_gear       JOINT_TARGET gainprm[0]  200.0  biasprm[:3] [0.0, -200.0, 0.0]  gear 1
  3  j_gear       JOINT_TARGET gainprm[0]   10.0  biasprm[:3] [0.0, 0.0, -10.0]  gear 1
  4  j_gear       CTRL_DIRECT  gainprm[0]   50.0  biasprm[:3] [0.0, -50.0, -2.0]  gear 2
  5  j_dampratio  CTRL_DIRECT  gainprm[0]  100.0  biasprm[:3] [0.0, -100.0, -4.0]  gear 1
control.mujoco.ctrl = [0.0, 0.0]

$ python repro_mujoco_variant_actuators.py --physics_variant physics
newton 1.6.0, physics_variant='physics', integrator='implicitfast'
  j_dampratio  target 0.5000  q(t=1 s) 0.5000
  j_gear       target 0.5000  q(t=1 s) 0.5000
MuJoCo actuators: nu = 4
  0  j_dampratio  JOINT_TARGET gainprm[0]  200.0  biasprm[:3] [0.0, -200.0, 0.0]  gear 1
  1  j_dampratio  JOINT_TARGET gainprm[0]   10.0  biasprm[:3] [0.0, 0.0, -10.0]  gear 1
  2  j_gear       JOINT_TARGET gainprm[0]  200.0  biasprm[:3] [0.0, -200.0, 0.0]  gear 1
  3  j_gear       JOINT_TARGET gainprm[0]   10.0  biasprm[:3] [0.0, 0.0, -10.0]  gear 1

$ python repro_mujoco_variant_actuators.py --physics_variant mujoco --integrator euler
newton 1.6.0, physics_variant='mujoco', integrator='euler'
  j_dampratio  target 0.5000  q(t=1 s) 0.3333
  j_gear       target 0.5000  q(t=1 s) 312.6107

System Info

  • Commit: develop 09b1d544d (2026-09-29)
  • Isaac Sim Version: 6.1.0-rc.26, with Newton 1.6.0 (develop's pin), mujoco 3.12.0, mujoco-warp 3.12.0 and warp 1.17.0
  • OS: Ubuntu 24.04.2 LTS
  • GPU: NVIDIA RTX PRO 5000 72GB Blackwell
  • CUDA: 13.0
  • GPU Driver: 580.126.20

Additional context

  • Newton behaves as documented: with the same Isaac Lab actuator, a plain <position kp="100" kv="10"/> row is converted to a joint target and reaches 0.5000. Only rows left as CTRL_DIRECT interfere.
  • The rows can be identified before simulation (mujoco:ctrl_source is CTRL_DIRECT, mujoco:actuator_target_label names the joint). Two possible directions: neutralize (zero gain/bias or drop) the imported CTRL_DIRECT rows on DOFs that an Isaac Lab actuator owns, with a log line; or raise/warn and name the row and joint.
  • Related: #6383 (item 4: an imported MjcActuator acting next to the joint drive on Newton; that PR removed the prims), #5806 (two controllers on one DOF on Newton, different path), and the mujoco.ctrl ownership comment in #7161.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • On Newton, the repro with physics_variant="mujoco" reaches 0.5000 on both joints with --integrator implicitfast and --integrator euler. Alternatively, articulation initialization fails or warns and names the conflicting MjcActuator rows.
  • Imported actuators that Isaac Lab does not replace keep their current behavior. This covers tendon actuators commanded through set_fixed_tendon_position_target_* and rows on DOFs that no Isaac Lab actuator owns.
  • A regression test covers a mujoco-variant asset with a gear/dampratio/filter actuator under an Isaac Lab actuator on Newton.