Skip to content

Commit 1daed39

Browse files
authored
[Backport release/3.0.0] Centralize shared physics preset ownership (#7312)
# Description Backports #7301 to `release/3.0.0` by cherry-picking the canonical merged commit `f86b4e1ad66e637e7770a727e181ffe150a2077b`. This centralizes backend physics presets at the task-family composition roots: - Kuka Allegro reuses the shared lift physics configuration. - SO-101 reuses the shared stack physics configuration. - Flat velocity environments mutate robot-specific MJWarp values directly instead of defining preset subclasses. - Newton MJWarp velocity environments use two shared physics substeps, with no robot-specific substep overrides. - The corresponding Anymal-D Newton visualizer goldens and changelog fragments are included. The cherry-pick applied without conflicts, and all 21 affected files are byte-for-byte identical to the merged #7301 versions. ## Validation - `uv run --extra test --frozen python -m pytest -q source/isaaclab_tasks/test/core/test_velocity_newton_cfg.py source/isaaclab_tasks/test/core/test_lift_kuka_ovphysx_presets.py source/isaaclab_tasks/test/core/test_lift_env_cfg.py` — 8 passed. - Direct construction audit — all 10 affected Newton velocity configs use `num_substeps=2`; SO-101 and Kuka inherit the intended shared physics values. - Structural audit — no `PhysicsCfg(RoughPhysicsCfg)`, `KukaAllegroPhysicsCfg`, or `SO101StackPhysicsCfg` remains in task code; robot-specific velocity configs do not assign `.num_substeps`. - `uv run --frozen isaaclab -f` — all hooks passed, including changelog and Git LFS checks.
1 parent 7ba89a0 commit 1daed39

21 files changed

Lines changed: 76 additions & 316 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Changed
2+
^^^^^^^
3+
4+
* **Breaking:** Changed Newton MJWarp velocity environments to use two physics substeps from their
5+
shared family configuration. Robot-specific velocity configs no longer override the substep count.

source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab.assets import ArticulationCfg, RigidObjectCfg
7-
from isaaclab.physics import PhysxAutoCfg
87
from isaaclab.utils.configclass import configclass
98

109
from isaaclab_tasks.contrib.stack import mdp
1110
from isaaclab_tasks.contrib.stack.stack_env_cfg import (
12-
PhysicsCfg,
1311
StackEnvCfg,
1412
StackEventCfg,
1513
apply_default_semantics,
@@ -52,21 +50,6 @@
5250
_SO101_BASE_SEAT_ROT = (0.0, 0.0, 0.70710678, 0.70710678)
5351

5452

55-
@configclass
56-
class SO101StackPhysicsCfg(PhysicsCfg):
57-
"""Physics presets for the SO-101 stack tasks.
58-
59-
Extends the stack-family presets with
60-
:attr:`~isaaclab_physx.physics.PhysxCfg.solve_articulation_contact_last` so contacts
61-
are solved after the articulation position drive and can stall the closing jaw at the
62-
object surface instead of letting it tunnel through grasped objects.
63-
"""
64-
65-
isaacsim_physx = PhysicsCfg().isaacsim_physx.replace(solve_articulation_contact_last=True)
66-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx)
67-
default = isaacsim_physx
68-
69-
7053
@configclass
7154
class SO101CubeStackEnvCfg(StackEnvCfg):
7255
"""Configuration for the SO-101 Cube Stack Environment (joint-position control).
@@ -144,7 +127,3 @@ def __post_init__(self):
144127
],
145128
marker_scale=(0.05, 0.05, 0.05),
146129
)
147-
148-
# simulation settings: solve finger contacts after the position drive so they can
149-
# stall the closing jaw at the object surface (see SO101StackPhysicsCfg).
150-
self.sim.physics = SO101StackPhysicsCfg()

source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ class PhysicsCfg(PresetCfg):
296296
gpu_found_lost_aggregate_pairs_capacity=1024 * 1024 * 4,
297297
gpu_total_aggregate_pairs_capacity=2**21,
298298
friction_correlation_distance=0.00625,
299+
# Let object contacts stall position-driven grippers before they tunnel through a grasp.
300+
solve_articulation_contact_last=True,
299301
)
300302
newton_mjwarp = NewtonCfg(
301303
solver_cfg=MJWarpSolverCfg(

source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/a1/flat_env_cfg.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,21 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
9-
10-
from isaaclab.physics import PhysxAutoCfg
11-
from isaaclab.sim import SimulationCfg
126
from isaaclab.utils.configclass import configclass
137

14-
from isaaclab_tasks.utils import PresetCfg
15-
168
from .rough_env_cfg import UnitreeA1RoughEnvCfg
179

1810

19-
@configclass
20-
class PhysicsCfg(PresetCfg):
21-
isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
22-
ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
23-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
24-
newton_mjwarp = NewtonCfg(
25-
solver_cfg=MJWarpSolverCfg(
26-
njmax=60,
27-
nconmax=30,
28-
cone="pyramidal",
29-
impratio=1,
30-
integrator="implicitfast",
31-
),
32-
num_substeps=1,
33-
debug_mode=False,
34-
)
35-
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
37-
38-
3911
@configclass
4012
class UnitreeA1FlatEnvCfg(UnitreeA1RoughEnvCfg):
41-
sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg())
42-
4313
def __post_init__(self):
4414
super().__post_init__()
4515

16+
# physics
17+
newton_mjwarp = self.sim.physics.newton_mjwarp
18+
newton_mjwarp.solver_cfg.njmax = 60
19+
newton_mjwarp.solver_cfg.nconmax = 30
20+
self.sim.physics.default = self.sim.physics.isaacsim_physx
4621
# scene
4722
self.scene.terrain.terrain_type = "plane"
4823
self.scene.terrain.terrain_generator = None

source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_b/flat_env_cfg.py

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,23 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
9-
10-
from isaaclab.physics import PhysxAutoCfg
11-
from isaaclab.sim import SimulationCfg
126
from isaaclab.utils.configclass import configclass
137

14-
from isaaclab_tasks.utils import PresetCfg
15-
168
from .rough_env_cfg import AnymalBRoughEnvCfg
179

1810

19-
@configclass
20-
class PhysicsCfg(PresetCfg):
21-
isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
22-
ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
23-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
24-
newton_mjwarp = NewtonCfg(
25-
solver_cfg=MJWarpSolverCfg(
26-
njmax=75,
27-
nconmax=15,
28-
cone="elliptic",
29-
impratio=100,
30-
integrator="implicitfast",
31-
),
32-
num_substeps=1,
33-
debug_mode=False,
34-
)
35-
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
37-
38-
3911
@configclass
4012
class AnymalBFlatEnvCfg(AnymalBRoughEnvCfg):
41-
sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg())
42-
4313
def __post_init__(self):
4414
super().__post_init__()
4515

16+
# physics
17+
newton_mjwarp = self.sim.physics.newton_mjwarp
18+
newton_mjwarp.solver_cfg.njmax = 75
19+
newton_mjwarp.solver_cfg.nconmax = 15
20+
newton_mjwarp.solver_cfg.cone = "elliptic"
21+
newton_mjwarp.solver_cfg.impratio = 100.0
22+
self.sim.physics.default = self.sim.physics.isaacsim_physx
4623
# scene
4724
self.scene.terrain.terrain_type = "plane"
4825
self.scene.terrain.terrain_generator = None

source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_c/flat_env_cfg.py

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,23 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
9-
10-
from isaaclab.physics import PhysxAutoCfg
11-
from isaaclab.sim import SimulationCfg
126
from isaaclab.utils.configclass import configclass
137

14-
from isaaclab_tasks.utils import PresetCfg
15-
168
from .rough_env_cfg import AnymalCRoughEnvCfg
179

1810

19-
@configclass
20-
class PhysicsCfg(PresetCfg):
21-
isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
22-
ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
23-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
24-
newton_mjwarp = NewtonCfg(
25-
solver_cfg=MJWarpSolverCfg(
26-
njmax=120,
27-
nconmax=15,
28-
cone="elliptic",
29-
impratio=100,
30-
integrator="implicitfast",
31-
),
32-
num_substeps=1,
33-
debug_mode=False,
34-
)
35-
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
37-
38-
3911
@configclass
4012
class AnymalCFlatEnvCfg(AnymalCRoughEnvCfg):
41-
sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg())
42-
4313
def __post_init__(self):
4414
super().__post_init__()
4515

16+
# physics
17+
newton_mjwarp = self.sim.physics.newton_mjwarp
18+
newton_mjwarp.solver_cfg.njmax = 120
19+
newton_mjwarp.solver_cfg.nconmax = 15
20+
newton_mjwarp.solver_cfg.cone = "elliptic"
21+
newton_mjwarp.solver_cfg.impratio = 100.0
22+
self.sim.physics.default = self.sim.physics.isaacsim_physx
4623
# scene
4724
self.scene.terrain.terrain_type = "plane"
4825
self.scene.terrain.terrain_generator = None

source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/go1/flat_env_cfg.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,21 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
9-
10-
from isaaclab.physics import PhysxAutoCfg
11-
from isaaclab.sim import SimulationCfg
126
from isaaclab.utils.configclass import configclass
137

14-
from isaaclab_tasks.utils import PresetCfg
15-
168
from .rough_env_cfg import UnitreeGo1RoughEnvCfg
179

1810

19-
@configclass
20-
class PhysicsCfg(PresetCfg):
21-
isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
22-
ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
23-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
24-
newton_mjwarp = NewtonCfg(
25-
solver_cfg=MJWarpSolverCfg(
26-
njmax=60,
27-
nconmax=25,
28-
cone="pyramidal",
29-
impratio=1,
30-
integrator="implicitfast",
31-
),
32-
num_substeps=1,
33-
debug_mode=False,
34-
)
35-
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
37-
38-
3911
@configclass
4012
class UnitreeGo1FlatEnvCfg(UnitreeGo1RoughEnvCfg):
41-
sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg())
42-
4313
def __post_init__(self):
4414
super().__post_init__()
4515

16+
# physics
17+
newton_mjwarp = self.sim.physics.newton_mjwarp
18+
newton_mjwarp.solver_cfg.njmax = 60
19+
newton_mjwarp.solver_cfg.nconmax = 25
20+
self.sim.physics.default = self.sim.physics.isaacsim_physx
4621
# scene
4722
self.scene.terrain.terrain_type = "plane"
4823
self.scene.terrain.terrain_generator = None

source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/spot/flat_env_cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PhysicsCfg(PresetCfg):
4949
use_mujoco_contacts=False,
5050
),
5151
collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000),
52-
num_substeps=1,
52+
num_substeps=2,
5353
debug_mode=False,
5454
default_shape_cfg=NewtonShapeCfg(margin=0.01),
5555
)

source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
from isaaclab_ov.physics import OvPhysxCfg
7-
86
from isaaclab.assets import ArticulationCfg
97
from isaaclab.managers import EventTermCfg as EventTerm
108
from isaaclab.managers import RewardTermCfg as RewTerm
119
from isaaclab.managers import SceneEntityCfg
12-
from isaaclab.physics import PhysxAutoCfg
1310
from isaaclab.sensors import CameraCfg, ContactSensorCfg
1411
from isaaclab.utils.configclass import configclass
1512

@@ -24,20 +21,6 @@
2421
FINGER_SENSORS = [f"{name}_object_s" for name in FINGERTIP_LIST if name != "thumb_link_3"]
2522

2623

27-
@configclass
28-
class KukaAllegroPhysicsCfg(lift.PhysicsCfg):
29-
"""Physics presets supported by the Kuka Allegro tasks."""
30-
31-
isaacsim_physx = lift.PhysicsCfg().isaacsim_physx
32-
ovphysx = OvPhysxCfg(
33-
gpu_max_rigid_patch_count=4 * 5 * 2**15,
34-
gpu_found_lost_pairs_capacity=2**26,
35-
)
36-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
37-
newton_mjwarp = lift.PhysicsCfg().newton_mjwarp
38-
default = newton_mjwarp
39-
40-
4124
@configclass
4225
class KukaAllegroSceneCfg(lift.SceneCfg):
4326
"""KukaAllegro scene for the Lift and Reorient tasks.
@@ -105,7 +88,6 @@ class KukaAllegroMixinCfg:
10588

10689
def __post_init__(self: lift.ReorientEnvCfg):
10790
super().__post_init__()
108-
self.sim.physics = KukaAllegroPhysicsCfg()
10991
self.commands.object_pose.body_name = "palm_link"
11092
events = self.events.conditional_reset.params["terms"]
11193
events["reset_robot_wrist_joint"].params["asset_cfg"] = SceneEntityCfg("robot", joint_names="iiwa7_joint_7")

source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from dataclasses import MISSING
77

88
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, NewtonCollisionPipelineCfg, NewtonShapeCfg
9+
from isaaclab_ov.physics import OvPhysxCfg
910
from isaaclab_physx.physics import PhysxCfg
1011

1112
import isaaclab.sim as sim_utils
@@ -490,6 +491,10 @@ class PhysicsCfg(PresetCfg):
490491
gpu_max_rigid_patch_count=4 * 5 * 2**15,
491492
gpu_found_lost_pairs_capacity=2**26,
492493
)
494+
ovphysx = OvPhysxCfg(
495+
gpu_max_rigid_patch_count=4 * 5 * 2**15,
496+
gpu_found_lost_pairs_capacity=2**26,
497+
)
493498
newton_mjwarp = NewtonCfg(
494499
solver_cfg=MJWarpSolverCfg(
495500
solver="newton",
@@ -509,7 +514,7 @@ class PhysicsCfg(PresetCfg):
509514
num_substeps=2,
510515
debug_mode=False,
511516
)
512-
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx)
517+
physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx)
513518
default = newton_mjwarp
514519

515520

0 commit comments

Comments
 (0)