Skip to content

Commit caca5c2

Browse files
ooctipusAntoineRichard
authored andcommitted
add note
1 parent 2d0d975 commit caca5c2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

source/isaaclab/isaaclab/envs/mdp/events.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,15 @@ def randomize_rigid_body_com(
645645
coms[env_ids[:, None], body_ids, :3] += rand_samples
646646

647647
# Newton's set_coms_index expects position-only (vec3f), while PhysX expects
648-
# the full pose (pos + quat). Detect backend to pass the correct shape.
648+
# the full pose (pos + quat).
649+
# NOTE: On Newton (MuJoCo Warp), runtime COM changes may cause simulation instability
650+
# because notify_model_changed(BODY_INERTIAL_PROPERTIES) does not fully recompute the
651+
# mass matrix after body_ipos changes. Use with caution until this is fixed upstream.
649652
manager_name = env.sim.physics_manager.__name__.lower()
650653
if "newton" in manager_name:
651-
asset.set_coms_index(coms=coms[..., :3], env_ids=env_ids)
654+
asset.set_coms_index(coms=coms[:, body_ids, :3], body_ids=body_ids, env_ids=env_ids)
652655
else:
653-
asset.set_coms_index(coms=coms, env_ids=env_ids)
656+
asset.set_coms_index(coms=coms[:, body_ids], body_ids=body_ids, env_ids=env_ids)
654657

655658

656659
class randomize_rigid_body_collider_offsets(ManagerTermBase):

0 commit comments

Comments
 (0)