diff --git a/source/isaaclab_tasks/changelog.d/shared-physics-preset-ownership.major.rst b/source/isaaclab_tasks/changelog.d/shared-physics-preset-ownership.major.rst new file mode 100644 index 000000000000..12c5085c3dd5 --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/shared-physics-preset-ownership.major.rst @@ -0,0 +1,5 @@ +Changed +^^^^^^^ + +* **Breaking:** Changed Newton MJWarp velocity environments to use two physics substeps from their + shared family configuration. Robot-specific velocity configs no longer override the substep count. diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py index 1a6d241d9ef1..0190ef1c0ae1 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py @@ -4,12 +4,10 @@ # SPDX-License-Identifier: BSD-3-Clause from isaaclab.assets import ArticulationCfg, RigidObjectCfg -from isaaclab.physics import PhysxAutoCfg from isaaclab.utils.configclass import configclass from isaaclab_tasks.contrib.stack import mdp from isaaclab_tasks.contrib.stack.stack_env_cfg import ( - PhysicsCfg, StackEnvCfg, StackEventCfg, apply_default_semantics, @@ -52,21 +50,6 @@ _SO101_BASE_SEAT_ROT = (0.0, 0.0, 0.70710678, 0.70710678) -@configclass -class SO101StackPhysicsCfg(PhysicsCfg): - """Physics presets for the SO-101 stack tasks. - - Extends the stack-family presets with - :attr:`~isaaclab_physx.physics.PhysxCfg.solve_articulation_contact_last` so contacts - are solved after the articulation position drive and can stall the closing jaw at the - object surface instead of letting it tunnel through grasped objects. - """ - - isaacsim_physx = PhysicsCfg().isaacsim_physx.replace(solve_articulation_contact_last=True) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx) - default = isaacsim_physx - - @configclass class SO101CubeStackEnvCfg(StackEnvCfg): """Configuration for the SO-101 Cube Stack Environment (joint-position control). @@ -144,7 +127,3 @@ def __post_init__(self): ], marker_scale=(0.05, 0.05, 0.05), ) - - # simulation settings: solve finger contacts after the position drive so they can - # stall the closing jaw at the object surface (see SO101StackPhysicsCfg). - self.sim.physics = SO101StackPhysicsCfg() diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py index e9a7c1168d51..b281000914d8 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py @@ -296,6 +296,8 @@ class PhysicsCfg(PresetCfg): gpu_found_lost_aggregate_pairs_capacity=1024 * 1024 * 4, gpu_total_aggregate_pairs_capacity=2**21, friction_correlation_distance=0.00625, + # Let object contacts stall position-driven grippers before they tunnel through a grasp. + solve_articulation_contact_last=True, ) newton_mjwarp = NewtonCfg( solver_cfg=MJWarpSolverCfg( diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/a1/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/a1/flat_env_cfg.py index 0f10d962b5dd..ef59316e1997 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/a1/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/a1/flat_env_cfg.py @@ -3,46 +3,21 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import UnitreeA1RoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=60, - nconmax=30, - cone="pyramidal", - impratio=1, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = isaacsim_physx - - @configclass class UnitreeA1FlatEnvCfg(UnitreeA1RoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 60 + newton_mjwarp.solver_cfg.nconmax = 30 + self.sim.physics.default = self.sim.physics.isaacsim_physx # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_b/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_b/flat_env_cfg.py index 37f30ee7ba9c..c255e4207417 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_b/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_b/flat_env_cfg.py @@ -3,46 +3,23 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import AnymalBRoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=75, - nconmax=15, - cone="elliptic", - impratio=100, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = isaacsim_physx - - @configclass class AnymalBFlatEnvCfg(AnymalBRoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 75 + newton_mjwarp.solver_cfg.nconmax = 15 + newton_mjwarp.solver_cfg.cone = "elliptic" + newton_mjwarp.solver_cfg.impratio = 100.0 + self.sim.physics.default = self.sim.physics.isaacsim_physx # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_c/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_c/flat_env_cfg.py index c55929f4663d..6e29d1955394 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_c/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/anymal_c/flat_env_cfg.py @@ -3,46 +3,23 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import AnymalCRoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=120, - nconmax=15, - cone="elliptic", - impratio=100, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = isaacsim_physx - - @configclass class AnymalCFlatEnvCfg(AnymalCRoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 120 + newton_mjwarp.solver_cfg.nconmax = 15 + newton_mjwarp.solver_cfg.cone = "elliptic" + newton_mjwarp.solver_cfg.impratio = 100.0 + self.sim.physics.default = self.sim.physics.isaacsim_physx # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/go1/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/go1/flat_env_cfg.py index a52f25f6c13f..d6907cba7ede 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/go1/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/go1/flat_env_cfg.py @@ -3,46 +3,21 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import UnitreeGo1RoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=60, - nconmax=25, - cone="pyramidal", - impratio=1, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = isaacsim_physx - - @configclass class UnitreeGo1FlatEnvCfg(UnitreeGo1RoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 60 + newton_mjwarp.solver_cfg.nconmax = 25 + self.sim.physics.default = self.sim.physics.isaacsim_physx # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/spot/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/spot/flat_env_cfg.py index 96f76d05fcdc..da3acaf7cd00 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/spot/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/velocity/config/spot/flat_env_cfg.py @@ -49,7 +49,7 @@ class PhysicsCfg(PresetCfg): use_mujoco_contacts=False, ), collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000), - num_substeps=1, + num_substeps=2, debug_mode=False, default_shape_cfg=NewtonShapeCfg(margin=0.01), ) diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py index 5d7549fdaf71..e4f304abe8d5 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/kuka_allegro/kuka_allegro_env_cfg.py @@ -3,13 +3,10 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_ov.physics import OvPhysxCfg - from isaaclab.assets import ArticulationCfg from isaaclab.managers import EventTermCfg as EventTerm from isaaclab.managers import RewardTermCfg as RewTerm from isaaclab.managers import SceneEntityCfg -from isaaclab.physics import PhysxAutoCfg from isaaclab.sensors import CameraCfg, ContactSensorCfg from isaaclab.utils.configclass import configclass @@ -24,20 +21,6 @@ FINGER_SENSORS = [f"{name}_object_s" for name in FINGERTIP_LIST if name != "thumb_link_3"] -@configclass -class KukaAllegroPhysicsCfg(lift.PhysicsCfg): - """Physics presets supported by the Kuka Allegro tasks.""" - - isaacsim_physx = lift.PhysicsCfg().isaacsim_physx - ovphysx = OvPhysxCfg( - gpu_max_rigid_patch_count=4 * 5 * 2**15, - gpu_found_lost_pairs_capacity=2**26, - ) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = lift.PhysicsCfg().newton_mjwarp - default = newton_mjwarp - - @configclass class KukaAllegroSceneCfg(lift.SceneCfg): """KukaAllegro scene for the Lift and Reorient tasks. @@ -105,7 +88,6 @@ class KukaAllegroMixinCfg: def __post_init__(self: lift.ReorientEnvCfg): super().__post_init__() - self.sim.physics = KukaAllegroPhysicsCfg() self.commands.object_pose.body_name = "palm_link" events = self.events.conditional_reset.params["terms"] events["reset_robot_wrist_joint"].params["asset_cfg"] = SceneEntityCfg("robot", joint_names="iiwa7_joint_7") diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py index 6def835fa8e2..8ce93bf7150f 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py @@ -6,6 +6,7 @@ from dataclasses import MISSING from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, NewtonCollisionPipelineCfg, NewtonShapeCfg +from isaaclab_ov.physics import OvPhysxCfg from isaaclab_physx.physics import PhysxCfg import isaaclab.sim as sim_utils @@ -490,6 +491,10 @@ class PhysicsCfg(PresetCfg): gpu_max_rigid_patch_count=4 * 5 * 2**15, gpu_found_lost_pairs_capacity=2**26, ) + ovphysx = OvPhysxCfg( + gpu_max_rigid_patch_count=4 * 5 * 2**15, + gpu_found_lost_pairs_capacity=2**26, + ) newton_mjwarp = NewtonCfg( solver_cfg=MJWarpSolverCfg( solver="newton", @@ -509,7 +514,7 @@ class PhysicsCfg(PresetCfg): num_substeps=2, debug_mode=False, ) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx) + physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) default = newton_mjwarp diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/flat_env_cfg.py index f2b96e28d0b5..47bd12334c24 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/flat_env_cfg.py @@ -3,45 +3,23 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import AnymalDRoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=60, - nconmax=25, - cone="elliptic", - impratio=100.0, - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = newton_mjwarp - - @configclass class AnymalDFlatEnvCfg(AnymalDRoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 60 + newton_mjwarp.solver_cfg.nconmax = 25 + newton_mjwarp.solver_cfg.cone = "elliptic" + newton_mjwarp.solver_cfg.impratio = 100.0 + self.sim.physics.default = newton_mjwarp # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/flat_env_cfg.py index 21ba95740cdb..c3ddf051d08e 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/flat_env_cfg.py @@ -3,46 +3,21 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import CassieRoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=52, - nconmax=15, - cone="pyramidal", - impratio=1.0, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = newton_mjwarp - - @configclass class CassieFlatEnvCfg(CassieRoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 52 + newton_mjwarp.solver_cfg.nconmax = 15 + self.sim.physics.default = newton_mjwarp # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py index 6a9bcf6d2284..ea76fc0fb5ff 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py @@ -58,8 +58,6 @@ class CassieRoughEnvCfg(LocomotionVelocityRoughEnvCfg): def __post_init__(self): super().__post_init__() - # sim - self.sim.physics.newton_mjwarp.num_substeps = 2 # scene self.scene.robot = CASSIE_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") self.scene.robot.actuators["legs"].armature = preset(default=0.0, newton_mjwarp=0.02) diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/flat_env_cfg.py index 5a53be0c3ee3..106494f29110 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/flat_env_cfg.py @@ -3,47 +3,22 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - from isaaclab.managers import SceneEntityCfg -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import G1RoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=95, - nconmax=10, - cone="pyramidal", - impratio=1.0, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = newton_mjwarp - - @configclass class G1FlatEnvCfg(G1RoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 95 + newton_mjwarp.solver_cfg.nconmax = 10 + self.sim.physics.default = newton_mjwarp # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/rough_env_cfg.py index 622f8e924723..319bae822577 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/rough_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/rough_env_cfg.py @@ -113,7 +113,6 @@ def __post_init__(self): # physics self.sim.physics.newton_mjwarp.solver_cfg.njmax = 300 - self.sim.physics.newton_mjwarp.num_substeps = 2 # scene self.scene.robot = G1_MINIMAL_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") self.scene.height_scanner.prim_path = "{ENV_REGEX_NS}/Robot/torso_link" diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/flat_env_cfg.py index bcb90551d801..838dfc880333 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/flat_env_cfg.py @@ -3,46 +3,21 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import UnitreeGo2RoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=65, - nconmax=35, - cone="pyramidal", - impratio=1.0, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = newton_mjwarp - - @configclass class UnitreeGo2FlatEnvCfg(UnitreeGo2RoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 65 + newton_mjwarp.solver_cfg.nconmax = 35 + self.sim.physics.default = newton_mjwarp # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/flat_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/flat_env_cfg.py index 1e77fdb16f3f..de70bbc6e780 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/flat_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/flat_env_cfg.py @@ -3,46 +3,21 @@ # # SPDX-License-Identifier: BSD-3-Clause -from isaaclab_newton.physics import KaminoPADMMSolverCfg, MJWarpSolverCfg, NewtonCfg -from isaaclab_ov.physics import OvPhysxCfg -from isaaclab_physx.physics import PhysxCfg - -from isaaclab.physics import PhysxAutoCfg -from isaaclab.sim import SimulationCfg from isaaclab.utils.configclass import configclass -from isaaclab_tasks.utils import PresetCfg - from .rough_env_cfg import H1RoughEnvCfg -@configclass -class PhysicsCfg(PresetCfg): - isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) - physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) - newton_mjwarp = NewtonCfg( - solver_cfg=MJWarpSolverCfg( - njmax=65, - nconmax=15, - cone="pyramidal", - impratio=1.0, - integrator="implicitfast", - ), - num_substeps=1, - debug_mode=False, - ) - newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) - default = newton_mjwarp - - @configclass class H1FlatEnvCfg(H1RoughEnvCfg): - sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) - def __post_init__(self): super().__post_init__() + # physics + newton_mjwarp = self.sim.physics.newton_mjwarp + newton_mjwarp.solver_cfg.njmax = 65 + newton_mjwarp.solver_cfg.nconmax = 15 + self.sim.physics.default = newton_mjwarp # scene self.scene.terrain.terrain_type = "plane" self.scene.terrain.terrain_generator = None diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py index 2f260dbccf2b..5f94c3a29759 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py @@ -6,7 +6,13 @@ import math from dataclasses import MISSING -from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, NewtonCollisionPipelineCfg, NewtonShapeCfg +from isaaclab_newton.physics import ( + KaminoPADMMSolverCfg, + MJWarpSolverCfg, + NewtonCfg, + NewtonCollisionPipelineCfg, + NewtonShapeCfg, +) from isaaclab_ov.physics import OvPhysxCfg from isaaclab_physx.physics import PhysxCfg @@ -45,7 +51,7 @@ @configclass class RoughPhysicsCfg(PresetCfg): - """Shared physics preset for all rough-terrain locomotion envs.""" + """Shared backend presets for locomotion velocity environments.""" isaacsim_physx = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) ovphysx = OvPhysxCfg(gpu_max_rigid_patch_count=10 * 2**15) @@ -60,10 +66,11 @@ class RoughPhysicsCfg(PresetCfg): use_mujoco_contacts=False, ), collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000), - num_substeps=1, + num_substeps=2, debug_mode=False, default_shape_cfg=NewtonShapeCfg(margin=0.0, ke=160000.0, kd=1100.0), ) + newton_kamino = NewtonCfg(solver_cfg=KaminoPADMMSolverCfg(max_contacts_per_world=64)) default = newton_mjwarp diff --git a/source/isaaclab_visualizers/changelog.d/shared-physics-preset-ownership.skip b/source/isaaclab_visualizers/changelog.d/shared-physics-preset-ownership.skip new file mode 100644 index 000000000000..d272949d5c51 --- /dev/null +++ b/source/isaaclab_visualizers/changelog.d/shared-physics-preset-ownership.skip @@ -0,0 +1 @@ +# Test-only golden reference update. diff --git a/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-tiled.png b/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-tiled.png index 470a62898d04..fffdf95e6604 100644 Binary files a/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-tiled.png and b/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-tiled.png differ diff --git a/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-viewport.png b/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-viewport.png index 456ab1e74f32..1922f0e84fd5 100644 Binary files a/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-viewport.png and b/source/isaaclab_visualizers/test/golden_images/anymal_d/newton-newton-viewport.png differ