Skip to content

Zero the Newton shape margin for ANYmal-D physX-Newton sim2sim - #6828

Open
Double7sBurger wants to merge 3 commits into
isaac-sim:developfrom
Double7sBurger:henry/anymald-newton-margin
Open

Zero the Newton shape margin for ANYmal-D physX-Newton sim2sim#6828
Double7sBurger wants to merge 3 commits into
isaac-sim:developfrom
Double7sBurger:henry/anymald-newton-margin

Conversation

@Double7sBurger

@Double7sBurger Double7sBurger commented Jul 31, 2026

Copy link
Copy Markdown

Description

ANYmal-D fails on rough terrain under the Newton MJWarp backend: the robot is
terminated by the 1 N base_contact check while it is still upright and walking
normally.

The cause is a collision-geometry interaction. ANYmal-D's base collider is a
rotationally-symmetric capsule of radius 0.12 m, which leaves only a few millimetres
of clearance to the thigh colliders during normal gait. Newton's shape margin extends
the collision surface outward and the margins of both shapes are summed, so the shared
1 cm default turns that clearance into near-constant base↔thigh overlap.

Measured under Newton MJWarp with a PhysX-trained checkpoint (4096 envs, 3000 steps,
~12k episodes):

shape margin success rate
0.01 (current default) 28.9%
0.005 71.2%
0.0 (this PR) 93.1%

PhysX reference on the same checkpoint: 96.2%.

The override is scoped to AnymalDRoughEnvCfg. Other robots keep the shared 1 cm
default, which they need for stable contact on triangle-mesh terrain. Verified at
runtime that ANYmal-D resolves to margin 0.0 while Go2, H1 and Cassie still resolve to
0.01, including when several tasks are constructed in the same process.

The root cause is really the asset — a rotationally-symmetric capsule is a poor
approximation of a flat chassis. Shrinking the capsule to r = 0.10 m recovers the same
policy to 95.6%, and margin 0.005 on top of that reaches 96.1%. That is the better
long-term fix, but it changes a shipped asset and would affect existing checkpoints, so
this PR takes the minimal config-only mitigation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst
    or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

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.
@Double7sBurger
Double7sBurger requested a review from a team July 31, 2026 11:24
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jul 31, 2026
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR scopes Newton’s zero shape margin to ANYmal-D locomotion configurations.

  • Overrides the ANYmal-D Newton MJWarp default shape margin to prevent spurious base-contact termination.
  • Adds an isaaclab_tasks changelog fragment documenting the fix and its task-specific scope.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness or security issues identified.

The override reaches the Newton MJWarp configuration selected for ANYmal-D, preserves the inherited shape configuration defaults other than margin, and does not alter other robot configurations.

Important Files Changed

Filename Overview
source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py Applies the zero-margin override to the mutable ANYmal-D Newton preset before backend resolution, while leaving other robots unchanged.
source/isaaclab_tasks/changelog.d/henry-anymald-newton-margin.rst Accurately documents the scoped ANYmal-D Newton collision-margin fix.

Reviews (1): Last reviewed commit: "Zero the Newton shape margin for ANYmal-..." | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The PR scopes the Newton MJWarp shape-margin override to AnymalDRoughEnvCfg and adds the required isaaclab_tasks changelog fragment. The task-local configuration path and post-initialization ordering are consistent with the intended fix.

  • Design and architecture: The shared Newton default remains unchanged for other robots, while ANYmal-D receives the zero-margin override after its inherited simulation configuration is initialized. The direct Newton import introduces backend coupling, but the supplied context does not establish that isaaclab_newton is optional or unavailable in supported task installations, so the reported import failure is not directly evidenced.
  • API: No public symbols or signatures change. The behavioral change is limited to the Newton MJWarp configuration for the ANYmal-D rough task and its derived configurations. The changelog fragment is correctly located and describes the fix in the appropriate category.
  • Implementation: The override executes after super().__post_init__(), ensuring it replaces the inherited shape configuration when newton_mjwarp is present. Constructing a fresh NewtonShapeCfg also restores any other shape fields to that class's defaults; this is a non-blocking tradeoff with the current code but should be kept in mind if additional per-task shape settings are introduced later.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@Double7sBurger Double7sBurger changed the title Zero the Newton shape margin for ANYmal-D for ANYmal-D phyX-Newton sim2sim Zero the Newton shape margin for ANYmal-D physX-Newton sim2sim Jul 31, 2026
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.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this should be merged if the better fix is to update the asset. We can update the asset so I would favor that option over changing this setting. If you need help on how to update the asset let us know!

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking for now.

@Double7sBurger

Double7sBurger commented Jul 31, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants