Skip to content

Draft: deformables#6202

Draft
huidongc wants to merge 3 commits into
isaac-sim:developfrom
huidongc:deformables
Draft

Draft: deformables#6202
huidongc wants to merge 3 commits into
isaac-sim:developfrom
huidongc:deformables

Conversation

@huidongc

Copy link
Copy Markdown
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • 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
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@huidongc huidongc marked this pull request as draft June 16, 2026 12:58
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jun 16, 2026
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This draft PR adds rendering correctness tests for a Franka cloth deformable environment, extending the existing rendering_test_utils.py infrastructure with a dedicated rendering_test_deformable helper and two new test modules.

  • rendering_test_utils.py: Adds DEFORMABLE_PHYSICS_RENDERER_AOV_COMBINATIONS / DEFORMABLE_KITLESS_PHYSICS_RENDERER_AOV_COMBINATIONS parameter sets, a _physics_preset_name_deformable helper mapping \"newton\" to \"newton_mjwarp_vbd\", a _make_franka_cloth_camera_env_cfg function that inlines test-local @configclass definitions, and rendering_test_deformable which runs 500 simulation warm-up steps before golden-image capture.
  • test_rendering_deformable.py: Kit-based test using AppLauncher; exercises newton+isaacsim_rtx (7 data types active) and newton+newton_warp (7 skipped).
  • test_rendering_deformable_kitless.py: Kitless counterpart; currently all 14 parametrized combinations carry skip marks.

Confidence Score: 4/5

Safe to merge as a draft — changes are test-only with no production code impact.

The change is purely additive test infrastructure. The kit-based deformable test follows established patterns and should work correctly. The style/quality concerns — all kitless combinations being pre-skipped, @configclass classes defined inside a repeatedly-called function, and the 500-step CI warm-up cost — are worth addressing before promoting from draft but do not break anything currently.

source/isaaclab_tasks/test/rendering_test_utils.py — specifically _make_franka_cloth_camera_env_cfg (inline configclass definitions) and DEFORMABLE_KITLESS_PHYSICS_RENDERER_AOV_COMBINATIONS (all entries skipped).

Important Files Changed

Filename Overview
source/isaaclab_tasks/test/rendering_test_utils.py Adds deformable-specific physics preset name helper, expands camera discovery in redirect_ovrtx_renderer_log_to_stdout, defines DEFORMABLE* parametrization constants, and adds _make_franka_cloth_camera_env_cfg + rendering_test_deformable helpers; all kitless deformable combos are pre-skipped.
source/isaaclab_tasks/test/core/test_rendering_deformable.py New kit-based rendering test for Franka cloth deformable. Structure mirrors existing rendering test files; imports AppLauncher before any simulation imports as required.
source/isaaclab_tasks/test/core/test_rendering_deformable_kitless.py New kit-less rendering test for Franka cloth deformable. All parametrized combinations carry skip marks (_OVRTX_NEWTON_DEFORMABLE_SKIP or _NEWTON_WARP_DEFORMABLE_SKIP), so this file produces zero passing tests today.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant PT as pytest parametrize
    participant TRD as rendering_test_deformable
    participant CFG as _make_franka_cloth_camera_env_cfg
    participant OV as _apply_overrides_to_env_cfg
    participant ENV as ManagerBasedRLEnv
    participant CAM as tiled_camera
    participant VAL as validate_camera_outputs

    PT->>TRD: (physics_backend, renderer, data_type)
    TRD->>CFG: data_type
    CFG-->>TRD: "TestFrankaClothCameraEnvCfg (inline @configclass)"
    TRD->>OV: "presets=newton_mjwarp_vbd,{renderer}"
    OV-->>TRD: patched env_cfg
    TRD->>ENV: ManagerBasedRLEnv(env_cfg)
    loop 500 steps
        TRD->>ENV: env.step(zero_actions)
    end
    TRD->>CAM: data.output[data_type]
    CAM-->>TRD: tensor
    TRD->>VAL: "{data_type: tensor}"
    VAL-->>TRD: pass / fail vs golden image
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant PT as pytest parametrize
    participant TRD as rendering_test_deformable
    participant CFG as _make_franka_cloth_camera_env_cfg
    participant OV as _apply_overrides_to_env_cfg
    participant ENV as ManagerBasedRLEnv
    participant CAM as tiled_camera
    participant VAL as validate_camera_outputs

    PT->>TRD: (physics_backend, renderer, data_type)
    TRD->>CFG: data_type
    CFG-->>TRD: "TestFrankaClothCameraEnvCfg (inline @configclass)"
    TRD->>OV: "presets=newton_mjwarp_vbd,{renderer}"
    OV-->>TRD: patched env_cfg
    TRD->>ENV: ManagerBasedRLEnv(env_cfg)
    loop 500 steps
        TRD->>ENV: env.step(zero_actions)
    end
    TRD->>CAM: data.output[data_type]
    CAM-->>TRD: tensor
    TRD->>VAL: "{data_type: tensor}"
    VAL-->>TRD: pass / fail vs golden image
Loading

Reviews (1): Last reviewed commit: "draft" | Re-trigger Greptile

Comment on lines +172 to +175
DEFORMABLE_KITLESS_PHYSICS_RENDERER_AOV_COMBINATIONS = [
*_make_sensor_data_type_params("newton", "ovrtx", extra_marks=(_OVRTX_NEWTON_DEFORMABLE_SKIP,)),
*_make_sensor_data_type_params("newton", "newton", extra_marks=(_NEWTON_WARP_DEFORMABLE_SKIP,)),
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 All kitless deformable combinations are pre-skipped

Both entries in DEFORMABLE_KITLESS_PHYSICS_RENDERER_AOV_COMBINATIONS carry a skip mark (_OVRTX_NEWTON_DEFORMABLE_SKIP for newton+ovrtx and _NEWTON_WARP_DEFORMABLE_SKIP for newton+newton), so test_rendering_deformable_kitless.py will collect 14 test IDs that are all skipped — no case actually exercises the code path today. If this is intentional scaffolding for follow-up work, a comment or xfail to that effect would make the intent clearer to future readers and CI triage.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +802 to +868
def _make_franka_cloth_camera_env_cfg(data_type: str):
"""Create a test-local Franka cloth camera env cfg without exposing a production task."""
import isaaclab.sim as sim_utils
from isaaclab.envs import mdp as env_mdp
from isaaclab.managers import ObservationGroupCfg as ObsGroup
from isaaclab.managers import ObservationTermCfg as ObsTerm
from isaaclab.managers import SceneEntityCfg
from isaaclab.sensors import CameraCfg
from isaaclab.utils.configclass import configclass

from isaaclab_tasks.core.lift.config.franka_soft.franka_cloth_env_cfg import FrankaClothEnvCfg, FrankaClothSceneCfg
from isaaclab_tasks.utils.presets import MultiBackendRendererCfg

@configclass
class TestFrankaClothCameraSceneCfg(FrankaClothSceneCfg):
"""Franka cloth scene with a test-only camera sensor."""

tiled_camera: CameraCfg = CameraCfg(
prim_path="/World/envs/env_.*/Camera",
offset=CameraCfg.OffsetCfg(
pos=(0.85, -0.55, 0.42),
rot=(0.52, 0.18, 0.27, 0.79),
convention="opengl",
),
data_types=[data_type],
spawn=sim_utils.PinholeCameraCfg(clipping_range=(0.01, 2.5)),
width=100,
height=100,
renderer_cfg=MultiBackendRendererCfg(),
)

@configclass
class TestFrankaClothCameraObservationsCfg:
"""Image-only observations for the local rendering test env."""

@configclass
class PolicyCfg(ObsGroup):
image = ObsTerm(
func=env_mdp.image,
params={"sensor_cfg": SceneEntityCfg("tiled_camera"), "data_type": data_type, "permute": True},
)

def __post_init__(self) -> None:
self.enable_corruption = False
self.concatenate_terms = True

policy: ObsGroup = PolicyCfg()

@configclass
class TestFrankaClothCameraEnvCfg(FrankaClothEnvCfg):
"""Test-only camera variant of ``Isaac-Lift-Cloth-Franka``."""

scene: TestFrankaClothCameraSceneCfg = TestFrankaClothCameraSceneCfg(
num_envs=4, env_spacing=2.5, replicate_physics=True
)
observations: TestFrankaClothCameraObservationsCfg = TestFrankaClothCameraObservationsCfg()

def __post_init__(self) -> None:
super().__post_init__()
self.commands.deformable_pose.debug_vis = False
self.events.reset_deformable.params["position_range"] = {
"x": (0.0, 0.0),
"y": (0.0, 0.0),
"z": (0.0, 0.0),
}

return TestFrankaClothCameraEnvCfg()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 @configclass classes defined inside a function called once per parametrized case

_make_franka_cloth_camera_env_cfg is invoked once for each of the 7 parametrized data_type values in a test session. Each call re-executes the @configclass decorator on three classes (TestFrankaClothCameraSceneCfg, TestFrankaClothCameraObservationsCfg, TestFrankaClothCameraEnvCfg) whose names are identical across invocations. If @configclass registers class names in any module-level registry (as some configclass frameworks do for serialisation/deserialization), repeated registration under the same name can silently overwrite entries or raise an error. Other rendering helpers in this file use pre-defined imported cfg classes (e.g. CartpoleCameraEnvCfg, ShadowHandCameraEnvCfg) to avoid this. Extracting the three inner classes to module level — parameterising them at construction time — would remove the risk.

Comment on lines +893 to +896
env = ManagerBasedRLEnv(env_cfg)

zero_actions = torch.zeros(env.num_envs, env.action_manager.total_action_dim, device=env.device)
for _ in range(500):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 500-step warm-up loop is unusually expensive for a CI rendering test

All other rendering helpers (rendering_test_cartpole, rendering_test_shadow_hand, rendering_test_dexsuite_kuka) capture the golden image immediately after environment creation without any simulation steps. The 500-step loop here adds substantial CI wall-clock time (multiplied across 7 data types × flaky reruns). If the cloth genuinely needs to settle before a stable image can be captured, it would help to document the minimum number of steps required and whether a smaller count (e.g. 50–100) achieves the same goal.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +884 to +889
env_cfg.scene.num_envs = 4

if renderer == "ovrtx_renderer":
_redirect_ovrtx_renderer_log_to_stdout(env_cfg)

test_name = "franka_cloth_deformable"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Redundant num_envs=4 assignment — the scene cfg is already constructed with num_envs=4 inside _make_franka_cloth_camera_env_cfg. The identical re-assignment here adds noise without effect.

Suggested change
env_cfg.scene.num_envs = 4
if renderer == "ovrtx_renderer":
_redirect_ovrtx_renderer_log_to_stdout(env_cfg)
test_name = "franka_cloth_deformable"
if renderer == "ovrtx_renderer":
_redirect_ovrtx_renderer_log_to_stdout(env_cfg)
test_name = "franka_cloth_deformable"

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant