Repository navigation
Adds benchmarking presets configuration to Shadow Hand Vision - #4845
Conversation
Greptile SummaryThis PR adds multi-physics (PhysX / Newton) and multi-render-backend (IsaacRTX / Warp / OVRTX) configuration presets to the Shadow Hand Vision task, along with a new Key changes:
Confidence Score: 2/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
CLI["CLI: presets=warp,rgb"] --> RC[resolve_preset_defaults]
RC --> VCfg[ShadowHandVisionEnvCfg / BenchmarkEnvCfg]
VCfg --> |tiled_camera preset| TC["_ShadowHandBaseTiledCameraCfg\n(data_types, renderer_cfg)"]
VCfg --> |feature_extractor| FE["FeatureExtractorCfg\n(enabled, train, ...)"]
subgraph ShadowHandVisionEnv.__init__
VAL["_validate_cfg(cfg)"]
FE_INIT["FeatureExtractor(cfg, device,\ncfg.tiled_camera.data_types)"]
end
TC --> VAL
FE --> VAL
VAL -->|"warp + unsupported type\nor depth-only + CNN enabled"| ERR["ValueError raised early"]
VAL -->|valid| FE_INIT
FE_INIT --> FEN["FeatureExtractorNetwork\n(num_channel=Σ channels,\ndata_types)"]
subgraph Per-step: _compute_image_observations
STEP["feature_extractor.step\n(camera_output, gt_pose)"]
STEP --> |enabled=False| ZERO["Return zeros (27-d)"]
STEP --> |enabled=True| PP["_preprocess_images\n(dict → (N,H,W,C) tensor)"]
PP --> CNN["CNN forward → predicted_pose"]
STEP --> |train=True| LOSS["MSE loss + backward"]
end
FEN --> STEP
Last reviewed commit: e91ff9c |
| elif dt == "depth": | ||
| img[img == float("inf")] = 0 | ||
| img /= 5.0 | ||
| max_val = img.max() | ||
| if max_val > 0: | ||
| img /= max_val |
There was a problem hiding this comment.
In-place mutation of depth sensor buffer
_preprocess_images modifies the depth tensor in-place without cloning it first. camera_output[dt].float() returns the same underlying storage when the tensor is already float32 (which Isaac Sim depth sensors produce). The three in-place operations (img[img == float("inf")] = 0, img /= 5.0, img /= max_val) therefore directly corrupt self._tiled_camera.data.output["depth"] — the sensor's own internal buffer.
This is inconsistent with _save_images (lines 234–239), which correctly calls .clone() on the depth tensor before any in-place modification.
After feature_extractor.step() returns, any caller that reads self._tiled_camera.data.output["depth"] within the same environment step will see normalized [0, 1] values instead of the original depth distances.
| elif dt == "depth": | |
| img[img == float("inf")] = 0 | |
| img /= 5.0 | |
| max_val = img.max() | |
| if max_val > 0: | |
| img /= max_val | |
| elif dt == "depth": | |
| img = img.clone() | |
| img[img == float("inf")] = 0 | |
| img /= 5.0 | |
| max_val = img.max() | |
| if max_val > 0: | |
| img /= max_val |
| warp: NewtonWarpRendererCfg = NewtonWarpRendererCfg() | ||
| """Newton Warp software renderer.""" | ||
|
|
||
| ovrtx: OVRTXRendererCfg = OVRTXRendererCfg() |
There was a problem hiding this comment.
maybe we can import the shared on, so we don't end up different naming conventions : D
| """ | ||
| renderer_type = getattr(cfg.tiled_camera.renderer_cfg, "renderer_type", None) | ||
| if renderer_type == "newton_warp": | ||
| unsupported = set(cfg.tiled_camera.data_types) - _WARP_SUPPORTED_DATA_TYPES |
There was a problem hiding this comment.
Just a small observation, something we could address in the future - this should be done by camera. If we request output types unsupported by the renderer we should throw or produce a warning.
| ValueError: If the Warp renderer is paired with an unsupported data type, or if a | ||
| depth-only camera is used without disabling the feature extractor. | ||
| """ | ||
| renderer_type = getattr(cfg.tiled_camera.renderer_cfg, "renderer_type", None) |
There was a problem hiding this comment.
This should be happening through isinstance(NewtonRendererConfg), the renderer_type is impl detail. We can address this later.
Description
Adds multi-physics and multi-render backend configuration presets to shadow hand vision task. also adds a variation for benchmarking that disables the CNN update.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there