Skip to content

Newton: push_by_setting_velocity causes training divergence (angular velocity frame mismatch) #5064

@ax-anoop

Description

@ax-anoop

Bug

push_by_setting_velocity causes 100% fall rate and training divergence when using the Newton physics backend (presets=newton). The same push magnitudes work correctly with PhysX.

Root Cause

push_by_setting_velocity calls asset.write_root_velocity_to_sim_index() which delegates to write_root_com_velocity_to_sim_index() via a warp kernel. This kernel appears to not correctly convert world-frame angular velocity to MuJoCo's body-frame qvel convention.

MuJoCo stores free joint velocities as [vx_world, vy_world, vz_world, wx_body, wy_body, wz_body] — the angular part is in body frame. The warp kernel appears to write world-frame angular velocity directly, creating physically incorrect torques that destabilize the robot.

Evidence: The equivalent push in mjlab (which uses the same MuJoCo physics) works correctly because it manually converts angular velocity:

# mjlab's working implementation:
ang_vel_b = quat_apply_inverse(quat_w, velocity[:, 3:])
velocity_qvel = torch.cat([velocity[:, :3], ang_vel_b], dim=-1)
self.data.qvel[env_ids, free_joint_v_adr] = velocity_qvel

Workaround

Bypass write_root_velocity_to_sim_index and write directly to model.joint_qd with manual frame conversion:

root_quat_w = wp.to_torch(asset.data.root_link_quat_w)[env_ids]
ang_vel_b = math_utils.quat_apply(math_utils.quat_conjugate(root_quat_w), vel_w[:, 3:])
joint_qd = wp.to_torch(model.joint_qd).reshape(num_envs, -1)
joint_qd[env_ids, :3] = vel_w[:, :3]   # linear (world frame)
joint_qd[env_ids, 3:6] = ang_vel_b     # angular (body frame)

Results

Push method 1K iter reward (4096 envs)
Stock push_by_setting_velocity -1028 (diverged, 100% falls)
Direct qvel write with frame conversion +16.07 (converges)
PhysX stock push (reference) +22.36

Reproduction

python scripts/train.py \
  --task Isaac-Velocity-Flat-H1-v0 \
  --num_envs 4096 --max_iterations 200 \
  presets=newton

The robot will start standing, then fall over by iteration 10 and never recover.

Environment

  • IsaacLab v3.0.0-beta
  • Isaac Sim 6.0 (from source, v6.0.0-dev2)
  • Newton/MuJoCo-Warp backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions