diff --git a/source/isaaclab/changelog.d/locomotion-newton-tuning.minor.rst b/source/isaaclab/changelog.d/locomotion-newton-tuning.minor.rst new file mode 100644 index 000000000000..dd8f9fe06402 --- /dev/null +++ b/source/isaaclab/changelog.d/locomotion-newton-tuning.minor.rst @@ -0,0 +1,5 @@ +Added +^^^^^ + +* Added :func:`~isaaclab.envs.mdp.body_lin_vel_out_of_manual_limit` to terminate environments when an + articulation body exceeds a configured linear speed. diff --git a/source/isaaclab_tasks/changelog.d/locomotion-newton-tuning.rst b/source/isaaclab_tasks/changelog.d/locomotion-newton-tuning.rst new file mode 100644 index 000000000000..a0f0b89779d1 --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/locomotion-newton-tuning.rst @@ -0,0 +1,5 @@ +Fixed +^^^^^ + +* Fixed Newton MJWarp locomotion training instability by tuning contact capacity and parameters, adjusting the + ANYmal-D initial height, and terminating excessively fast bodies. diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py index f79379bbc06e..5a8421445975 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py @@ -19,8 +19,7 @@ class AnymalDRoughEnvCfg(LocomotionVelocityRoughEnvCfg): def __post_init__(self): super().__post_init__() - # sim - # lower margin to avoid self-collision - self.sim.physics.newton_mjwarp.default_shape_cfg.margin = 0.001 # scene - self.scene.robot = ANYMAL_D_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") + self.scene.robot = ANYMAL_D_CFG.replace( + prim_path="{ENV_REGEX_NS}/Robot", init_state=ANYMAL_D_CFG.init_state.replace(pos=(0.0, 0.0, 0.65)) + ) 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 957cb8d0f614..54832022cca8 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 @@ -57,7 +57,7 @@ class CassieRoughEnvCfg(LocomotionVelocityRoughEnvCfg): def __post_init__(self): super().__post_init__() - + 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/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/g1/rough_env_cfg.py index 415b816c323a..b36da32002ad 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 @@ -110,7 +110,7 @@ class G1RoughEnvCfg(LocomotionVelocityRoughEnvCfg): def __post_init__(self): super().__post_init__() - + 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/velocity_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py index 6e9dd535159c..796cf9591a6a 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 @@ -52,8 +52,8 @@ class RoughPhysicsCfg(PresetCfg): physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) newton_mjwarp = NewtonCfg( solver_cfg=MJWarpSolverCfg( - njmax=200, - nconmax=100, + njmax=1000, + nconmax=300, cone="pyramidal", impratio=1.0, integrator="implicitfast", @@ -62,10 +62,7 @@ class RoughPhysicsCfg(PresetCfg): collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000), num_substeps=1, debug_mode=False, - # 1 cm shape margin is the single most important Newton setting for rough - # terrain — without it, non-AnymalD robots fail to learn stable contact - # on triangle-mesh terrain. See isaaclab_newton 0.5.22 changelog. - default_shape_cfg=NewtonShapeCfg(margin=0.01), + default_shape_cfg=NewtonShapeCfg(margin=0.0, ke=160000.0, kd=1100.0), ) default = isaacsim_physx