From 1aa74a9d773323586845d0a475320aa309eb51c2 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 31 Jul 2026 18:32:36 +0800 Subject: [PATCH 1/3] Zero the Newton shape margin for ANYmal-D The shared 1 cm shape margin inflates ANYmal-D's base capsule into its own thigh colliders, which trips the base_contact termination while the robot is upright and walking. Zeroing the margin for this task raises success under Newton MJWarp from 28.9% to 93.1%. Scoped to AnymalDRoughEnvCfg; other robots keep the shared default. --- .../changelog.d/henry-anymald-newton-margin.rst | 7 +++++++ .../core/velocity/config/anymal_d/rough_env_cfg.py | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 source/isaaclab_tasks/changelog.d/henry-anymald-newton-margin.rst diff --git a/source/isaaclab_tasks/changelog.d/henry-anymald-newton-margin.rst b/source/isaaclab_tasks/changelog.d/henry-anymald-newton-margin.rst new file mode 100644 index 000000000000..455f639bc8a0 --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/henry-anymald-newton-margin.rst @@ -0,0 +1,7 @@ +Fixed +^^^^^ + +* Fixed ANYmal-D rough-terrain locomotion terminating on spurious base contacts under the + Newton MJWarp backend by setting the Newton shape margin to zero in + :class:`~isaaclab_tasks.core.velocity.config.anymal_d.rough_env_cfg.AnymalDRoughEnvCfg`. + Other robots keep the shared default. diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py index 66c4122e43e4..6072382f1bf8 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-3-Clause +from isaaclab_newton.physics import NewtonShapeCfg + from isaaclab.utils.configclass import configclass from isaaclab_tasks.core.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg @@ -21,3 +23,10 @@ def __post_init__(self): super().__post_init__() # switch robot to anymal-d self.scene.robot = ANYMAL_D_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") + + # ANYmal-D's base capsule passes within a few millimetres of the thigh colliders, so + # the shared 1 cm Newton shape margin inflates them into constant overlap and trips + # the base_contact termination. Other robots keep the default. + newton_cfg = getattr(self.sim.physics, "newton_mjwarp", None) + if newton_cfg is not None: + newton_cfg.default_shape_cfg = NewtonShapeCfg(margin=0.0) From dc08dcac452d601a354830b40a3492191c4d5fb3 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 31 Jul 2026 19:26:30 +0800 Subject: [PATCH 2/3] Add Henry Hu to CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4fd3a69de84a..8c70e227e188 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -97,6 +97,7 @@ Guidelines for modifications: * Grzegorz Malczyk * Haoran Zhou * Harsh Patel +* Henry Hu * HoJin Jeon * Hongwei Xiong * Hongyu Li From b1ddc63d0cb5fce2778e369c9221505c57a0a45a Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 31 Jul 2026 19:35:35 +0800 Subject: [PATCH 3/3] Preserve other shape fields when overriding the margin Copy the inherited NewtonShapeCfg and change only the margin, instead of constructing a fresh one that would reset gap, ke, kd and mu to class defaults if the shared preset ever customises them. This also drops the direct isaaclab_newton import. --- .../core/velocity/config/anymal_d/rough_env_cfg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py index 6072382f1bf8..98afc61234e0 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py @@ -4,8 +4,6 @@ # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import NewtonShapeCfg - from isaaclab.utils.configclass import configclass from isaaclab_tasks.core.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg @@ -29,4 +27,4 @@ def __post_init__(self): # the base_contact termination. Other robots keep the default. newton_cfg = getattr(self.sim.physics, "newton_mjwarp", None) if newton_cfg is not None: - newton_cfg.default_shape_cfg = NewtonShapeCfg(margin=0.0) + newton_cfg.default_shape_cfg = newton_cfg.default_shape_cfg.replace(margin=0.0)