Skip to content

Commit 98e8cf7

Browse files
committed
Centralize shared physics presets
1 parent 21bc111 commit 98e8cf7

15 files changed

Lines changed: 31 additions & 117 deletions

File tree

source/isaaclab_tasks/changelog.d/shared-physics-preset-ownership.skip

Whitespace-only changes.

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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
97

10-
from isaaclab.physics import PhysxAutoCfg
118
from isaaclab.sim import SimulationCfg
129
from isaaclab.utils.configclass import configclass
1310

14-
from isaaclab_tasks.utils import PresetCfg
11+
from isaaclab_tasks.core.velocity.velocity_env_cfg import RoughPhysicsCfg
1512

1613
from .rough_env_cfg import UnitreeA1RoughEnvCfg
1714

1815

1916
@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)
17+
class PhysicsCfg(RoughPhysicsCfg):
2418
newton_mjwarp = NewtonCfg(
2519
solver_cfg=MJWarpSolverCfg(
2620
njmax=60,
@@ -33,7 +27,7 @@ class PhysicsCfg(PresetCfg):
3327
debug_mode=False,
3428
)
3529
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
30+
default = RoughPhysicsCfg().isaacsim_physx
3731

3832

3933
@configclass

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
97

10-
from isaaclab.physics import PhysxAutoCfg
118
from isaaclab.sim import SimulationCfg
129
from isaaclab.utils.configclass import configclass
1310

14-
from isaaclab_tasks.utils import PresetCfg
11+
from isaaclab_tasks.core.velocity.velocity_env_cfg import RoughPhysicsCfg
1512

1613
from .rough_env_cfg import AnymalBRoughEnvCfg
1714

1815

1916
@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)
17+
class PhysicsCfg(RoughPhysicsCfg):
2418
newton_mjwarp = NewtonCfg(
2519
solver_cfg=MJWarpSolverCfg(
2620
njmax=75,
@@ -33,7 +27,7 @@ class PhysicsCfg(PresetCfg):
3327
debug_mode=False,
3428
)
3529
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
30+
default = RoughPhysicsCfg().isaacsim_physx
3731

3832

3933
@configclass

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
97

10-
from isaaclab.physics import PhysxAutoCfg
118
from isaaclab.sim import SimulationCfg
129
from isaaclab.utils.configclass import configclass
1310

14-
from isaaclab_tasks.utils import PresetCfg
11+
from isaaclab_tasks.core.velocity.velocity_env_cfg import RoughPhysicsCfg
1512

1613
from .rough_env_cfg import AnymalCRoughEnvCfg
1714

1815

1916
@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)
17+
class PhysicsCfg(RoughPhysicsCfg):
2418
newton_mjwarp = NewtonCfg(
2519
solver_cfg=MJWarpSolverCfg(
2620
njmax=120,
@@ -33,7 +27,7 @@ class PhysicsCfg(PresetCfg):
3327
debug_mode=False,
3428
)
3529
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
30+
default = RoughPhysicsCfg().isaacsim_physx
3731

3832

3933
@configclass

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
97

10-
from isaaclab.physics import PhysxAutoCfg
118
from isaaclab.sim import SimulationCfg
129
from isaaclab.utils.configclass import configclass
1310

14-
from isaaclab_tasks.utils import PresetCfg
11+
from isaaclab_tasks.core.velocity.velocity_env_cfg import RoughPhysicsCfg
1512

1613
from .rough_env_cfg import UnitreeGo1RoughEnvCfg
1714

1815

1916
@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)
17+
class PhysicsCfg(RoughPhysicsCfg):
2418
newton_mjwarp = NewtonCfg(
2519
solver_cfg=MJWarpSolverCfg(
2620
njmax=60,
@@ -33,7 +27,7 @@ class PhysicsCfg(PresetCfg):
3327
debug_mode=False,
3428
)
3529
newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64))
36-
default = isaacsim_physx
30+
default = RoughPhysicsCfg().isaacsim_physx
3731

3832

3933
@configclass

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

source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/flat_env_cfg.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg
7-
from isaaclab_ov.physics import OvPhysxCfg
8-
from isaaclab_physx.physics import PhysxCfg
97

10-
from isaaclab.physics import PhysxAutoCfg
118
from isaaclab.sim import SimulationCfg
129
from isaaclab.utils.configclass import configclass
1310

14-
from isaaclab_tasks.utils import PresetCfg
11+
from isaaclab_tasks.core.velocity.velocity_env_cfg import RoughPhysicsCfg
1512

1613
from .rough_env_cfg import AnymalDRoughEnvCfg
1714

1815

1916
@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)
17+
class PhysicsCfg(RoughPhysicsCfg):
2418
newton_mjwarp = NewtonCfg(
2519
solver_cfg=MJWarpSolverCfg(
2620
njmax=60,

0 commit comments

Comments
 (0)