Skip to content

Commit 6bc3603

Browse files
authored
Retune Newton and PhysX environments for Franka cloth lift (#6998)
# Description Adds `isaacsim_physx` support to the Franka cloth lift tasks as a follow-up to #6831, while retaining `newton_mjwarp_vbd_proxy` as the default physics preset. This PR: - Adds PhysX physics, deformable material, collision, and scene presets for the standard and camera cloth tasks. - Disables scene replication for PhysX deformables and increases the GPU found/lost pair capacity for large environments. - Matches backend-specific cloth density and material conventions, lowers support friction, adjusts reset clearance, and fully closes the gripper on the thin cloth. - Updates the state-machine demo to use the task-specific IK preset, allow enough time for the low-PD Franka, and grasp the raised cloth fold. - Updates the environment catalog and generated browser data to advertise PhysX support. - Restores the already released removal of `NewtonCfg.simplify_meshes`, which was reintroduced during branch integration, and records the Newton-only cleanup with a skip fragment. No new dependencies are required. ### Validation - [x] `uv run isaaclab -f` - [x] `uv run python tools/changelog/cli.py check develop` in a clean clone - [x] `uv run --isolated --extra test -- make -C docs current-docs` in a clean clone - [x] `PYTHONPATH="$PWD/source/isaaclab_tasks:$PYTHONPATH" uv run python scripts/environments/state_machine/lift_franka_soft.py --task Isaac-Lift-Cloth-Franka --num_envs 1 --num_steps 500 --viz none presets=isaacsim_physx` ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Documentation update ## Screenshots Not applicable. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the pre-commit checks with `uv run isaaclab -f` - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent c10cbb7 commit 6bc3603

102 files changed

Lines changed: 285 additions & 209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/source/_static/css/environment-browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
["Isaac-Fourbar-Pole-Swingup", "rsl_rl", "newton_kamino", "", ""],
2222
["Isaac-Humanoid-Direct", "rl_games,rsl_rl,skrl", "isaacsim_physx,newton_mjwarp,ovphysx", "", ""],
2323
["Isaac-Humanoid", "rl_games,rsl_rl,skrl,sb3", "isaacsim_physx,newton_mjwarp,ovphysx", "", ""],
24-
["Isaac-Lift-Cloth-Franka", "rsl_rl", "newton_mjwarp_vbd_proxy", "", "ik,joint"],
25-
["Isaac-Lift-Cloth-Franka-Camera", "rsl_rl", "newton_mjwarp_vbd_proxy", "isaacsim_rtx,newton_renderer,ovrtx", "ik,joint"],
24+
["Isaac-Lift-Cloth-Franka", "rsl_rl", "isaacsim_physx,newton_mjwarp_vbd_proxy", "", "ik,joint"],
25+
["Isaac-Lift-Cloth-Franka-Camera", "rsl_rl", "isaacsim_physx,newton_mjwarp_vbd_proxy", "isaacsim_rtx,newton_renderer,ovrtx", "ik,joint"],
2626
["Isaac-Lift-Franka", "rsl_rl", "isaacsim_physx,newton_mjwarp", "", "cube,shapes"],
2727
["Isaac-Lift-KukaAllegro", "rsl_rl", "isaacsim_physx,newton_mjwarp,ovphysx", "", "cube,shapes"],
2828
["Isaac-Lift-KukaAllegro-Camera", "rsl_rl", "isaacsim_physx,newton_mjwarp,ovphysx", "isaacsim_rtx,newton_renderer,ovrtx", "albedo128,albedo256,albedo64,cube,depth128,depth256,depth64,duo_camera,raycaster_depth128,raycaster_depth256,raycaster_depth64,rgb128,rgb256,rgb64,semantic_segmentation128,semantic_segmentation256,semantic_segmentation64,shapes,simple_shading_constant_diffuse128,simple_shading_constant_diffuse256,simple_shading_constant_diffuse64,simple_shading_diffuse_mdl128,simple_shading_diffuse_mdl256,simple_shading_diffuse_mdl64,simple_shading_full_mdl128,simple_shading_full_mdl256,simple_shading_full_mdl64,single_camera"],

docs/source/overview/environments.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ for the lift-cube environment:
256256
| | | | ``newton_renderer``, ``ovrtx`` |
257257
| | | | **presets=** ``ik``, ``joint`` |
258258
+-------------------------+------------------------------+-----------------------------------------------------------------------------+-----------------------------------------+
259-
| |lift-cloth-franka| | |lift-cloth-franka-link| | Lift a deformable cloth from a table with the Franka robot | **physics=** |
259+
| |lift-cloth-franka| | |lift-cloth-franka-link| | Lift a deformable cloth from a table with the Franka robot | **physics=** ``isaacsim_physx``, |
260260
| | | | ``newton_mjwarp_vbd_proxy`` |
261261
| | | | **presets=** ``ik``, ``joint`` |
262262
+-------------------------+------------------------------+-----------------------------------------------------------------------------+-----------------------------------------+
263-
| |lift-cloth-franka| | |lift-cloth-franka-cam-link| | Camera (vision) variant of the cloth lift task using RGB observations | **physics=** |
263+
| |lift-cloth-franka| | |lift-cloth-franka-cam-link| | Camera (vision) variant of the cloth lift task using RGB observations | **physics=** ``isaacsim_physx``, |
264264
| | | | ``newton_mjwarp_vbd_proxy`` |
265265
| | | | **renderer=** ``isaacsim_rtx``, |
266266
| | | | ``newton_renderer``, ``ovrtx`` |
@@ -1115,12 +1115,12 @@ including disabling runtime perturbations used for training.
11151115
* - Isaac-Lift-Cloth-Franka
11161116
- Manager Based
11171117
- **rsl_rl** (PPO)
1118-
- | **physics=** ``newton_mjwarp_vbd_proxy``
1118+
- | **physics=** ``isaacsim_physx``, ``newton_mjwarp_vbd_proxy``
11191119
| **presets=** ``ik``, ``joint``
11201120
* - Isaac-Lift-Cloth-Franka-Camera
11211121
- Manager Based
11221122
- **rsl_rl** (PPO)
1123-
- | **physics=** ``newton_mjwarp_vbd_proxy``
1123+
- | **physics=** ``isaacsim_physx``, ``newton_mjwarp_vbd_proxy``
11241124
| **renderer=** ``isaacsim_rtx``, ``newton_renderer``, ``ovrtx``
11251125
| **presets=** ``ik``, ``joint``
11261126
* - Isaac-Lift-Franka

scripts/environments/state_machine/lift_franka_soft.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from isaaclab.visualizers import VisualizerCfg
3333

3434
import isaaclab_tasks # noqa: F401
35-
from isaaclab_tasks.core.lift.config.franka_soft.franka_soft_env_cfg import ActionsCfg
3635
from isaaclab_tasks.utils import resolve_task_config, setup_preset_cli
3736

3837
# add argparse arguments
@@ -167,7 +166,7 @@ class PickSmWaitTime:
167166
REST = wp.constant(0.2)
168167
APPROACH_ABOVE_OBJECT = wp.constant(1.0)
169168
APPROACH_OBJECT = wp.constant(1.5)
170-
GRASP_OBJECT = wp.constant(1.0)
169+
GRASP_OBJECT = wp.constant(1.5)
171170
LIFT_OBJECT = wp.constant(1.5)
172171
OPEN_GRIPPER = wp.constant(0.0)
173172

@@ -265,9 +264,17 @@ def main():
265264
env_cfg, _ = resolve_task_config(args_cli.task, "")
266265
env_cfg.sim.device = args_cli.device
267266
env_cfg.scene.num_envs = args_cli.num_envs
268-
# the state machine emits absolute end-effector poses, so pick the IK action preset; the env
269-
# defaults to relative joint targets, which RL trains on.
270-
env_cfg.actions = ActionsCfg().ik
267+
# Scripted demo: keep only the time-out, extended to 10 s so the slow low-PD Franka can finish a
268+
# pick-and-lift, and drop the failure terminations so a transient bound or velocity spike does
269+
# not cut a run short.
270+
env_cfg.episode_length_s = 10.0
271+
for term_name in list(vars(env_cfg.terminations)):
272+
if term_name != "time_out":
273+
setattr(env_cfg.terminations, term_name, None)
274+
# the state machine emits absolute end-effector poses, so pick the task's own IK action preset
275+
# (e.g. the cloth closes the gripper fully); the env otherwise defaults to relative joint
276+
# targets, which RL trains on.
277+
env_cfg.actions = type(env_cfg)().actions.ik
271278
env_cfg.viewer.eye = (1.3, 0.6, 0.5)
272279
env_cfg.viewer.lookat = (0.5, 0.0, 0.05)
273280
env_cfg.sim.default_visualizer_cfg = VisualizerCfg(eye=env_cfg.viewer.eye, lookat=env_cfg.viewer.lookat)
@@ -291,7 +298,10 @@ def main():
291298
object_grasp_orientation = torch.zeros((env.unwrapped.num_envs, 4), device=env.unwrapped.device)
292299
object_grasp_orientation[:, 0] = 1.0
293300
# Grasp 1 cm below the deformable's centre of mass, so the fingers close around its lower half.
294-
object_local_grasp_position = torch.tensor([0.0, 0.0, -0.01], device=env.unwrapped.device)
301+
# The cloth drapes over a support cube, so its COM sits well below the graspable fold; reach
302+
# 8 cm higher to close on the raised cloth instead of the table.
303+
grasp_z = -0.01 + (0.08 if "Cloth" in args_cli.task else 0.0)
304+
object_local_grasp_position = torch.tensor([0.0, 0.0, grasp_z], device=env.unwrapped.device)
295305

296306
# create state machine
297307
pick_sm = PickAndLiftSm(env_cfg.sim.dt * env_cfg.decimation, env.unwrapped.num_envs, env.unwrapped.device)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Internal: restored the already released removal of ``NewtonCfg.simplify_meshes`` after a merge reintroduced the field.

source/isaaclab_newton/isaaclab_newton/physics/newton_manager_cfg.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,6 @@ class NewtonCfg(PhysicsCfg):
191191
:class:`NewtonShapeCfg` for the declared fields.
192192
"""
193193

194-
simplify_meshes: bool = True
195-
"""Whether Newton replication simplifies mesh colliders to convex hulls.
196-
197-
Keep this enabled for most rigid-body scenes. Disable it when exact triangle
198-
meshes are intentional, for example thin or hollow MPM colliders.
199-
"""
200-
201194
load_visual_shapes: bool | None = None
202195
"""Whether Newton replication imports visual-only geometry from USD.
203196
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Added
2+
^^^^^
3+
4+
* Added ``isaacsim_physx`` support to the Franka cloth lift tasks.
5+
6+
Fixed
7+
^^^^^
8+
9+
* Fixed success table visualization markers appearing at the world origin
10+
before the first environment step.

source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_cloth_env_cfg.py

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, NewtonCollisionPipelineCfg
1111
from isaaclab_newton.sim.schemas import NewtonDeformableBodyPropertiesCfg
1212
from isaaclab_newton.sim.spawners.materials import NewtonSurfaceDeformableBodyMaterialCfg
13+
from isaaclab_physx.physics import PhysxCfg
14+
from isaaclab_physx.sim.schemas import PhysxCollisionCfg, PhysxDeformableBodyPropertiesCfg
15+
from isaaclab_physx.sim.spawners.materials import PhysxSurfaceDeformableBodyMaterialCfg
1316

1417
import isaaclab.sim as sim_utils
15-
from isaaclab.assets import AssetBaseCfg, RigidObjectCfg
18+
from isaaclab.assets import RigidObjectCfg
1619
from isaaclab.assets.deformable_object import DeformableObjectCfg
1720
from isaaclab.managers import EventTermCfg as EventTerm
1821
from isaaclab.managers import RewardTermCfg as RewTerm
1922
from isaaclab.managers import SceneEntityCfg
23+
from isaaclab.physics import PhysxAutoCfg
2024
from isaaclab.sensors import CameraCfg
2125
from isaaclab.utils.configclass import configclass
2226

@@ -28,7 +32,6 @@
2832
from ... import mdp
2933
from .franka_soft_env_cfg import (
3034
FRANKA_CAMERA_CFG,
31-
TABLE_SPAWN_CFG,
3235
FrankaCameraObservationsCfg,
3336
FrankaSoftEnvCfg,
3437
_FrankaSoftSceneCfg,
@@ -87,6 +90,10 @@ class PhysicsCfg(PresetCfg):
8790
num_substeps=2,
8891
)
8992

93+
isaacsim_physx: PhysxCfg = PhysxCfg(gpu_found_lost_pairs_capacity=2**22)
94+
95+
physx: PhysxAutoCfg = PhysxAutoCfg(isaacsim_physx=isaacsim_physx)
96+
9097
default = newton_mjwarp_vbd_proxy
9198

9299

@@ -95,14 +102,14 @@ class PhysicsCfg(PresetCfg):
95102
rigid_props=sim_utils.RigidBodyPropertiesCfg(kinematic_enabled=True, disable_gravity=True),
96103
mass_props=sim_utils.MassPropertiesCfg(mass=1.0),
97104
collision_props=sim_utils.CollisionPropertiesCfg(),
98-
physics_material=sim_utils.RigidBodyMaterialCfg(static_friction=0.1, dynamic_friction=0.1),
105+
physics_material=sim_utils.RigidBodyMaterialCfg(static_friction=0.01, dynamic_friction=0.01),
99106
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.2, 0.2, 0.25)),
100107
)
101108

102109

103110
@configclass
104111
class DeformableCfg(PresetCfg):
105-
"""Preset config for the deformable object, matching the Newton example."""
112+
"""Preset configurations for the cloth."""
106113

107114
newton_mjwarp_vbd_proxy: DeformableObjectCfg = DeformableObjectCfg(
108115
prim_path="{ENV_REGEX_NS}/Deformable",
@@ -113,7 +120,7 @@ class DeformableCfg(PresetCfg):
113120
deformable_props=NewtonDeformableBodyPropertiesCfg(),
114121
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.95, 0.85, 0.1)),
115122
physics_material=NewtonSurfaceDeformableBodyMaterialCfg(
116-
density=10.0,
123+
density=1.0,
117124
particle_radius=0.002,
118125
tri_ke=5e2,
119126
tri_ka=5e2,
@@ -124,6 +131,30 @@ class DeformableCfg(PresetCfg):
124131
),
125132
)
126133

134+
physx: DeformableObjectCfg = DeformableObjectCfg(
135+
prim_path="{ENV_REGEX_NS}/Deformable",
136+
init_state=DeformableObjectCfg.InitialStateCfg(pos=(0.4, 0.0, 0.102), rot=(0.70710678, 0.0, 0.0, 0.70710678)),
137+
spawn=sim_utils.MeshRectangleCfg(
138+
size=(0.2, 0.2),
139+
resolution=(8, 8),
140+
deformable_props=PhysxDeformableBodyPropertiesCfg(),
141+
collision_props=[PhysxCollisionCfg(rest_offset=0.002, contact_offset=0.01)],
142+
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.95, 0.85, 0.1)),
143+
physics_material=PhysxSurfaceDeformableBodyMaterialCfg(
144+
density=1000.0,
145+
surface_thickness=0.001,
146+
poissons_ratio=0.25,
147+
youngs_modulus=1e6,
148+
surface_bend_stiffness=1e6,
149+
elasticity_damping=1e-1,
150+
bend_damping=1e-1,
151+
static_friction=10.0,
152+
dynamic_friction=10.0,
153+
),
154+
),
155+
)
156+
isaacsim_physx = physx
157+
127158
default = newton_mjwarp_vbd_proxy
128159

129160

@@ -133,17 +164,6 @@ class FrankaClothSceneCfg(_FrankaSoftSceneCfg):
133164

134165
deformable: DeformableCfg = DeformableCfg()
135166

136-
# Low-friction table so the cloth slides freely instead of sticking. Effective cloth-table
137-
# friction is sqrt(soft_contact_mu * shape_mu); this sets shape_mu without touching the global
138-
# soft_contact_mu that governs the gripper's hold on the cloth.
139-
table: AssetBaseCfg = AssetBaseCfg(
140-
prim_path="{ENV_REGEX_NS}/Table",
141-
init_state=AssetBaseCfg.InitialStateCfg(pos=[0.5, 0.0, -0.525]),
142-
spawn=TABLE_SPAWN_CFG.replace(
143-
physics_material=sim_utils.RigidBodyMaterialCfg(static_friction=0.1, dynamic_friction=0.1),
144-
),
145-
)
146-
147167
support_neg_y: RigidObjectCfg = RigidObjectCfg(
148168
prim_path="{ENV_REGEX_NS}/SupportNegY",
149169
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.4, -0.02, 0.075)),
@@ -164,6 +184,10 @@ class FrankaClothScenePresetCfg(PresetCfg):
164184
num_envs=2048, env_spacing=2.0, replicate_physics=True
165185
)
166186

187+
# PhysX does not support replicating physics for deformable objects
188+
physx: FrankaClothSceneCfg = FrankaClothSceneCfg(num_envs=2048, env_spacing=2.0, replicate_physics=False)
189+
isaacsim_physx = physx
190+
167191
default = newton_mjwarp_vbd_proxy
168192

169193

@@ -174,6 +198,18 @@ class FrankaClothCameraSceneCfg(FrankaClothSceneCfg):
174198
base_camera: CameraCfg = FRANKA_CAMERA_CFG
175199

176200

201+
@configclass
202+
class FrankaClothCameraScenePresetCfg(PresetCfg):
203+
"""Scene presets for visual Franka cloth lifting."""
204+
205+
newton_mjwarp_vbd_proxy: FrankaClothCameraSceneCfg = FrankaClothCameraSceneCfg(
206+
num_envs=128, env_spacing=2.5, replicate_physics=True
207+
)
208+
physx: FrankaClothCameraSceneCfg = FrankaClothCameraSceneCfg(num_envs=128, env_spacing=2.5, replicate_physics=False)
209+
isaacsim_physx = physx
210+
default = newton_mjwarp_vbd_proxy
211+
212+
177213
@configclass
178214
class FrankaClothEventCfg(FrankaSoftEventCfg):
179215
"""Reset and startup events for the Franka cloth environment."""
@@ -183,7 +219,7 @@ class FrankaClothEventCfg(FrankaSoftEventCfg):
183219
mode="reset",
184220
params={
185221
"position_range": {"x": (-0.1, 0.1), "y": (-0.25, 0.25), "z": (0.0, 0.0)},
186-
"clear_gap_range": (0.008, 0.03),
222+
"clear_gap_range": (0.01, 0.03),
187223
"asset_cfg": SceneEntityCfg("deformable"),
188224
"support_cfg": (SceneEntityCfg("support_neg_y"), SceneEntityCfg("support_pos_y")),
189225
},
@@ -224,13 +260,15 @@ def __post_init__(self) -> None:
224260
super().__post_init__()
225261
# override the soft-beam physics with the cloth presets
226262
self.sim.physics = PhysicsCfg()
263+
# Fully close the gripper on the thin cloth; the shared beam default only closes to 0.01 m.
264+
self.actions.ik.gripper_action.close_command_expr = {"panda_finger_joint1": 0.0}
227265

228266

229267
@configclass
230268
class FrankaClothCameraEnvCfg(FrankaClothEnvCfg):
231269
"""Visual Franka surface-deformable lifting environment."""
232270

233-
scene: FrankaClothCameraSceneCfg = FrankaClothCameraSceneCfg(num_envs=128, env_spacing=2.5, replicate_physics=True)
271+
scene: FrankaClothCameraScenePresetCfg = FrankaClothCameraScenePresetCfg()
234272
observations: FrankaCameraObservationsCfg = FrankaCameraObservationsCfg()
235273

236274
def __post_init__(self) -> None:

source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@ class PhysicsCfg(PresetCfg):
182182
num_substeps=2,
183183
)
184184

185-
isaacsim_physx: PhysxCfg = PhysxCfg(
186-
friction_offset_threshold=0.005,
187-
friction_correlation_distance=0.01,
188-
)
185+
isaacsim_physx: PhysxCfg = PhysxCfg()
189186

190187
physx: PhysxAutoCfg = PhysxAutoCfg(isaacsim_physx=isaacsim_physx)
191188

@@ -369,7 +366,7 @@ class _IkActionsCfg:
369366
asset_name="robot",
370367
joint_names=["panda_finger_joint1"],
371368
open_command_expr={"panda_finger_joint1": 0.04},
372-
close_command_expr={"panda_finger_joint1": 0.015},
369+
close_command_expr={"panda_finger_joint1": 0.01},
373370
)
374371

375372

source/isaaclab_tasks/isaaclab_tasks/core/lift/mdp/commands/pose_commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def __init__(self, cfg: ObjectUniformPoseCommandCfg, env: ManagerBasedEnv):
9090

9191
self.success_visualizer = VisualizationMarkers(self.cfg.success_visualizer_cfg)
9292
self.success_visualizer.set_visibility(True)
93+
if self.success_vis_asset is not None:
94+
self.success_visualizer.visualize(self._get_success_vis_pos_w())
9395

9496
# adds (optional) cmd kind and element names for leapp export
9597
# during export, semantic data about this command will be used to annotate the command input
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)