Skip to content

Commit 4e0a2d0

Browse files
committed
Match consolidated camera orientation for retired Albedo / SimpleShading IDs
The pre-existing develop consolidated ``MultiDataTypeCartpoleTiledCameraCfg`` uses a uniform identity-rotation camera for all data-type variants. The historical per-variant cfgs (``CartpoleAlbedoCameraEnvCfg`` and the three ``CartpoleSimpleShading*CameraEnvCfg``) had a 180-degree rotated camera. The merge from develop briefly reintroduced that rotation locally; the rendering tests captured against develop's identity-rotation baseline flagged the divergence on the consolidated path. Drop the local rotation override so the consolidated cfg matches develop's captured baseline. The deprecation shim returns the consolidated cfg verbatim, so users of the retired task IDs now see the consolidated camera orientation starting from this PR -- migration to the consolidated task ID with ``presets=<name>`` carries that uniform pose anyway. Test expectations updated accordingly.
1 parent 6f3c258 commit 4e0a2d0

2 files changed

Lines changed: 17 additions & 24 deletions

File tree

source/isaaclab_tasks/isaaclab_tasks/direct/cartpole/cartpole_camera_presets_env_cfg.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,13 @@ class CartpoleTiledCameraCfg(CameraCfg):
4747
height: int = 100
4848
renderer_cfg: MultiBackendRendererCfg = MultiBackendRendererCfg()
4949

50-
# Class-local helper (`_` prefix -> resolver skips it, not a variant). 180-degree
51-
# offset matches the historical Albedo / SimpleShading per-variant camera
52-
# orientations (the dropped *-Camera-Direct-v0 task IDs).
53-
_ROTATED_OFFSET = CameraCfg.OffsetCfg(pos=(-5.0, 0.0, 2.0), rot=(1.0, 0.0, 0.0, 0.0), convention="world")
54-
5550
default = CartpoleTiledCameraCfg(data_types=["rgb"])
5651
depth = CartpoleTiledCameraCfg(data_types=["depth"])
57-
albedo = CartpoleTiledCameraCfg(data_types=["albedo"], offset=_ROTATED_OFFSET)
52+
albedo = CartpoleTiledCameraCfg(data_types=["albedo"])
5853
semantic_segmentation = CartpoleTiledCameraCfg(data_types=["semantic_segmentation"])
59-
simple_shading_constant_diffuse = CartpoleTiledCameraCfg(
60-
data_types=["simple_shading_constant_diffuse"], offset=_ROTATED_OFFSET
61-
)
62-
simple_shading_diffuse_mdl = CartpoleTiledCameraCfg(
63-
data_types=["simple_shading_diffuse_mdl"], offset=_ROTATED_OFFSET
64-
)
65-
simple_shading_full_mdl = CartpoleTiledCameraCfg(data_types=["simple_shading_full_mdl"], offset=_ROTATED_OFFSET)
54+
simple_shading_constant_diffuse = CartpoleTiledCameraCfg(data_types=["simple_shading_constant_diffuse"])
55+
simple_shading_diffuse_mdl = CartpoleTiledCameraCfg(data_types=["simple_shading_diffuse_mdl"])
56+
simple_shading_full_mdl = CartpoleTiledCameraCfg(data_types=["simple_shading_full_mdl"])
6657
rgb = default
6758

6859

source/isaaclab_tasks/test/test_cartpole_preset_deprecations.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,27 @@ def test_consolidated_task_id_loads_without_deprecation(task_id: str) -> None:
155155
assert messages == [], f"{task_id}: unexpected deprecation warning(s): {messages}"
156156

157157

158-
# Historical camera offset rotations from the old per-variant cfgs in
159-
# cartpole_camera_env_cfg.py. RGB / Depth used the identity; Albedo and the
160-
# three SimpleShading variants used a 180-degree rotation.
158+
# All variants resolve to the consolidated cfg's identity-offset camera. Develop's
159+
# ``MultiDataTypeCartpoleTiledCameraCfg`` chose a uniform camera pose for all
160+
# variants (the historical per-variant cfgs had a 180-degree rotation for Albedo /
161+
# SimpleShading, but that rotation was dropped when the consolidated task landed
162+
# in develop). The deprecation shim returns the consolidated cfg's variant, so
163+
# users of the retired task IDs see the consolidated task's camera orientation
164+
# starting from this PR -- migrate to the consolidated task and pick the variant
165+
# via ``presets=<name>``.
161166
_IDENTITY_ROT = (0.0, 0.0, 0.0, 1.0)
162-
_ROTATED_ROT = (1.0, 0.0, 0.0, 0.0)
163167

164168
# (deprecated direct camera task id, expected data_types value,
165169
# expected obs channels, expected offset rotation).
166170
# Verifies the shim atomically selects (observation_space, data_types,
167-
# camera offset) so the loaded cfg matches the historical per-variant class
168-
# bit-for-bit -- a regression in any axis would silently change behavior
169-
# for users migrating from the deprecated task id.
171+
# camera offset) so the loaded cfg matches the consolidated PresetCfg's variant.
170172
_DIRECT_CAMERA_SHAPE_PINS = [
171173
("Isaac-Cartpole-RGB-Camera-Direct-v0", ["rgb"], 3, _IDENTITY_ROT),
172174
("Isaac-Cartpole-Depth-Camera-Direct-v0", ["depth"], 1, _IDENTITY_ROT),
173-
("Isaac-Cartpole-Albedo-Camera-Direct-v0", ["albedo"], 3, _ROTATED_ROT),
174-
("Isaac-Cartpole-SimpleShading-Constant-Camera-Direct-v0", ["simple_shading_constant_diffuse"], 3, _ROTATED_ROT),
175-
("Isaac-Cartpole-SimpleShading-Diffuse-Camera-Direct-v0", ["simple_shading_diffuse_mdl"], 3, _ROTATED_ROT),
176-
("Isaac-Cartpole-SimpleShading-Full-Camera-Direct-v0", ["simple_shading_full_mdl"], 3, _ROTATED_ROT),
175+
("Isaac-Cartpole-Albedo-Camera-Direct-v0", ["albedo"], 3, _IDENTITY_ROT),
176+
("Isaac-Cartpole-SimpleShading-Constant-Camera-Direct-v0", ["simple_shading_constant_diffuse"], 3, _IDENTITY_ROT),
177+
("Isaac-Cartpole-SimpleShading-Diffuse-Camera-Direct-v0", ["simple_shading_diffuse_mdl"], 3, _IDENTITY_ROT),
178+
("Isaac-Cartpole-SimpleShading-Full-Camera-Direct-v0", ["simple_shading_full_mdl"], 3, _IDENTITY_ROT),
177179
]
178180

179181

0 commit comments

Comments
 (0)