Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Guidelines for modifications:
* Rafael Wiltz
* Renaud Poncelet
* René Zurbrügg
* Richard Lei
* Richard Schmitt
* RinZ27
* Ritvik Singh
Expand Down
10 changes: 10 additions & 0 deletions source/isaaclab_tasks/changelog.d/extend-test-distance-aovs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Added
^^^^^

* Added ``distance_to_camera`` and ``distance_to_image_plane`` camera presets to
:class:`~isaaclab_tasks.core.cartpole.cartpole_direct_camera_env_cfg.CartpoleTiledCameraCfg`,
:class:`~isaaclab_tasks.core.cartpole.cartpole_manager_camera_env_cfg.CartpoleTiledCameraCfg`,
:class:`~isaaclab_tasks.core.dexsuite.config.kuka_allegro.camera_cfg.BaseTiledCameraCfg`,
:class:`~isaaclab_tasks.core.dexsuite.config.kuka_allegro.camera_cfg.WristTiledCameraCfg`, and
:class:`~isaaclab_tasks.core.shadow_hand.shadow_hand_vision_env_cfg.ShadowHandVisionTiledCameraCfg`,
enabling golden-image rendering tests for these depth-like AOV types.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class BaseCartpoleTiledCameraCfg(CameraCfg):

default = BaseCartpoleTiledCameraCfg(data_types=["rgb"])
depth = BaseCartpoleTiledCameraCfg(data_types=["depth"])
distance_to_camera = BaseCartpoleTiledCameraCfg(data_types=["distance_to_camera"])
distance_to_image_plane = BaseCartpoleTiledCameraCfg(data_types=["distance_to_image_plane"])
albedo = BaseCartpoleTiledCameraCfg(data_types=["albedo"])
semantic_segmentation = BaseCartpoleTiledCameraCfg(data_types=["semantic_segmentation"])
simple_shading_constant_diffuse = BaseCartpoleTiledCameraCfg(data_types=["simple_shading_constant_diffuse"])
Expand Down Expand Up @@ -73,6 +75,8 @@ class BaseCartpoleCameraEnvCfg(CartpoleEnvCfg):

default = BaseCartpoleCameraEnvCfg()
depth = BaseCartpoleCameraEnvCfg(observation_space=[1, 100, 100])
distance_to_camera = BaseCartpoleCameraEnvCfg(observation_space=[1, 100, 100])
distance_to_image_plane = BaseCartpoleCameraEnvCfg(observation_space=[1, 100, 100])
albedo = BaseCartpoleCameraEnvCfg()
semantic_segmentation = BaseCartpoleCameraEnvCfg(observation_space=[4, 100, 100])
simple_shading_constant_diffuse = BaseCartpoleCameraEnvCfg()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class BaseCartpoleTiledCameraCfg(CameraCfg):

default = BaseCartpoleTiledCameraCfg(data_types=["rgb"])
depth = BaseCartpoleTiledCameraCfg(data_types=["depth"])
distance_to_camera = BaseCartpoleTiledCameraCfg(data_types=["distance_to_camera"])
distance_to_image_plane = BaseCartpoleTiledCameraCfg(data_types=["distance_to_image_plane"])
albedo = BaseCartpoleTiledCameraCfg(data_types=["albedo"])
semantic_segmentation = BaseCartpoleTiledCameraCfg(data_types=["semantic_segmentation"])
simple_shading_constant_diffuse = BaseCartpoleTiledCameraCfg(data_types=["simple_shading_constant_diffuse"])
Expand Down Expand Up @@ -167,6 +169,8 @@ def __post_init__(self):

rgb = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("rgb"))
depth = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("depth"))
distance_to_camera = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("distance_to_camera"))
distance_to_image_plane = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("distance_to_image_plane"))
albedo = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("albedo"))
semantic_segmentation = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("semantic_segmentation"))
simple_shading_constant_diffuse = BaseCartpoleCameraEnvCfg(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ class BaseTiledCameraCfg(PresetCfg):
depth64 = BASE_CAMERA_CFG.replace(data_types=["depth"], width=64, height=64)
depth128 = BASE_CAMERA_CFG.replace(data_types=["depth"], width=128, height=128)
depth256 = BASE_CAMERA_CFG.replace(data_types=["depth"], width=256, height=256)
distance_to_camera64 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=64, height=64)
distance_to_camera128 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=128, height=128)
distance_to_camera256 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=256, height=256)
distance_to_image_plane64 = BASE_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=64, height=64)
distance_to_image_plane128 = BASE_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=128, height=128)
distance_to_image_plane256 = BASE_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=256, height=256)
albedo64 = BASE_CAMERA_CFG.replace(data_types=["albedo"], width=64, height=64)
albedo128 = BASE_CAMERA_CFG.replace(data_types=["albedo"], width=128, height=128)
albedo256 = BASE_CAMERA_CFG.replace(data_types=["albedo"], width=256, height=256)
Expand Down Expand Up @@ -180,6 +186,12 @@ class WristTiledCameraCfg(PresetCfg):
semantic_segmentation64 = WRIST_CAMERA_CFG.replace(data_types=["semantic_segmentation"], width=64, height=64)
semantic_segmentation128 = WRIST_CAMERA_CFG.replace(data_types=["semantic_segmentation"], width=128, height=128)
semantic_segmentation256 = WRIST_CAMERA_CFG.replace(data_types=["semantic_segmentation"], width=256, height=256)
distance_to_camera64 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=64, height=64)
distance_to_camera128 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=128, height=128)
distance_to_camera256 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=256, height=256)
distance_to_image_plane64 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=64, height=64)
distance_to_image_plane128 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=128, height=128)
distance_to_image_plane256 = WRIST_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=256, height=256)
# raycaster camera presets
raycaster_depth64 = WRIST_RAYCASTER_CAMERA_CFG.replace(pattern_cfg=RAY_PATTERN.replace(width=64, height=64))
raycaster_depth128 = WRIST_RAYCASTER_CAMERA_CFG.replace(pattern_cfg=RAY_PATTERN.replace(width=128, height=128))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ class ShadowHandVisionTiledCameraCfg(PresetCfg):
presets=depth,ovrtx_renderer # depth rendering with OVRTX renderer
"""

distance_to_camera: _ShadowHandBaseTiledCameraCfg = _ShadowHandBaseTiledCameraCfg(data_types=["distance_to_camera"])
"""Distance to camera [m] (1 channel).

.. warning::
This preset is intended for **benchmarking only**. The keypoint-regression CNN
cannot be meaningfully trained from depth alone. Use it with
:class:`ShadowHandVisionBenchmarkEnvCfg` (``feature_extractor.enabled=False``).
"""

distance_to_image_plane: _ShadowHandBaseTiledCameraCfg = _ShadowHandBaseTiledCameraCfg(
data_types=["distance_to_image_plane"]
)
"""Distance to image plane [m] (1 channel).

.. warning::
This preset is intended for **benchmarking only**. The keypoint-regression CNN
cannot be meaningfully trained from depth alone. Use it with
:class:`ShadowHandVisionBenchmarkEnvCfg` (``feature_extractor.enabled=False``).
"""

semantic_segmentation: _ShadowHandBaseTiledCameraCfg = _ShadowHandBaseTiledCameraCfg(
data_types=["semantic_segmentation"]
)
Expand Down Expand Up @@ -135,7 +155,10 @@ def validate_config(self):
"Choose a compatible preset, e.g. presets=newton_renderer,rgb."
)

if set(self.tiled_camera.data_types) == {"depth"} and self.feature_extractor.enabled:
non_depth_data_types = set(self.tiled_camera.data_types).difference(
{"depth", "distance_to_image_plane", "distance_to_camera"}
)
if self.tiled_camera.data_types and not non_depth_data_types and self.feature_extractor.enabled:
raise ValueError(
"Depth-only camera data type is intended for benchmarking only. "
"The keypoint-regression CNN cannot be meaningfully trained from depth alone. "
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion source/isaaclab_tasks/test/rendering_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
"simple_shading_full_mdl",
"semantic_segmentation",
"depth",
"distance_to_camera",
"distance_to_image_plane",
)


Expand Down Expand Up @@ -632,7 +634,7 @@ def rendering_test_shadow_hand(
if renderer == "ovrtx_renderer":
_redirect_ovrtx_renderer_log_to_stdout(env_cfg)

if data_type == "depth":
if data_type in {"depth", "distance_to_camera", "distance_to_image_plane"}:
# Disable CNN forward pass as it cannot be meaningfully trained from depth alone and will raise a ValueError.
env_cfg.feature_extractor.enabled = False

Expand Down
Loading