Enable Spot Newton MJWarp preset#5940
Conversation
There was a problem hiding this comment.
Review: Enable Spot Newton MJWarp preset
Verdict: ✅ Approve — clean, well-scoped configuration change
Summary
This PR enables the Newton collision pipeline for the Spot MJWarp preset by switching from MuJoCo-based contacts (use_mujoco_contacts=True) to Newton's own collision system, and tunes the associated solver/collision capacity parameters. The change is minimal (1 file, ~6 net additions) and well-targeted.
Analysis
Configuration Changes:
| Parameter | Before | After | Assessment |
|---|---|---|---|
njmax |
45 | 130 | ~3× increase in constraint capacity — appropriate for Newton collision pipeline which generates more constraint rows than MuJoCo contacts for articulated robots |
nconmax |
30 | 40 | Modest contact capacity increase |
use_mujoco_contacts |
(default: True) | False |
Core change — enables Newton's own collision detection |
collision_cfg |
(not set) | NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000) |
Configures triangle mesh collision budget for Newton pipeline |
default_shape_cfg |
(not set) | NewtonShapeCfg(margin=0.01) |
Sets collision margin for shape expansion |
Correctness:
- All new imports (
NewtonCollisionPipelineCfg,NewtonShapeCfg) are used immediately — no dead code. - Cross-referencing with Go2's config (
njmax=65, nconmax=35, no Newton collision pipeline): Spot is a heavier, more complex quadruped with more contact surfaces, so the ~2× multiplier onnjmaxrelative to Go2 is reasonable. margin=0.01(1cm) is a standard value for locomotion tasks — small enough to avoid ghost contacts while providing adequate broadphase expansion.- Setting
use_mujoco_contacts=Falsewhile addingcollision_cfgforms a coherent switch: the collision source changes from MuJoCo to Newton's native pipeline.
Performance Considerations:
max_triangle_pairs=2_500_000reserves GPU memory for collision pair buffers. For flat-terrain scenarios this is generous but safe — it won't degrade performance, just pre-allocates memory (~tens of MB).- The increased
njmax(130) means larger constraint Jacobian matrices per environment. This is well within typical GPU capacity for batched simulation. nconmax=40is conservative — Newton clamps rather than crashes if exceeded, so no stability risk.
Missing Rough-Terrain Config:
- The Spot config directory has only
flat_env_cfg.py(unlike Go2 which has both flat + rough). This is not a concern for this PR, but worth noting that a rough-terrain variant with Newton would likely need highermax_triangle_pairs.
CI Status
| Check | Status |
|---|---|
| pre-commit | ✅ Pass |
| Build Wheel | ✅ Pass |
| Check for Broken Links | ✅ Pass |
| Check changelog fragments | ❌ Fail |
| Installation Tests | ⏳ In progress |
The changelog check failure is a repo policy requirement (not a code defect). A changelog fragment may be needed before merge.
Recommendation
Approve — this is a straightforward, well-reasoned configuration change that correctly enables Newton's collision pipeline for Spot. The parameter values are consistent with the codebase patterns and appropriately scaled for the robot's complexity.
|
would be good to cherry pick this to the release branch as well |
Summary
Test Plan
./isaaclab.sh -p -c "from isaaclab_tasks.core.velocity.config.spot.flat_env_cfg import PhysicsCfg; cfg = PhysicsCfg().newton_mjwarp; print(cfg.solver_cfg.njmax, cfg.solver_cfg.nconmax, cfg.solver_cfg.use_mujoco_contacts, cfg.collision_cfg.max_triangle_pairs, cfg.default_shape_cfg.margin)"SKIP=check-git-lfs-pointers ./isaaclab.sh -f./isaaclab.sh -f(blocked locally becausegit-lfsis not installed)