Skip to content
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Guidelines for modifications:
* Vladimir Fokow
* Wei Yang
* Xavier Nal
* Xiaodi Yuan
* Xinjie Yao
* Xinpeng Liu
* Yang Jin
Expand Down
5 changes: 5 additions & 0 deletions source/isaaclab/isaaclab/sensors/camera/tiled_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ def _update_buffers_impl(self, env_ids: Sequence[int]):
if data_type == "motion_vectors":
tiled_data_buffer = tiled_data_buffer[:, :, :2].contiguous()

# For normals, we only require the first three channels of the tiled buffer
# Note: Not doing this breaks the alignment of the data (check: https://github.com/isaac-sim/IsaacLab/issues/4239)
if data_type == "normals":
tiled_data_buffer = tiled_data_buffer[:, :, :3].contiguous()

wp.launch(
kernel=reshape_tiled_image,
dim=(self._view.count, self.cfg.height, self.cfg.width),
Expand Down
3 changes: 3 additions & 0 deletions source/isaaclab/test/sensors/test_tiled_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ def test_normals_only_camera(setup_camera, device):
assert im_data.shape == (num_cameras, camera_cfg.height, camera_cfg.width, 3)
for i in range(4):
assert im_data[i].mean() > 0.0
# check normal norm is approximately 1
norms = torch.norm(im_data, dim=-1)
assert torch.allclose(norms, torch.ones_like(norms), atol=1e-9)
assert camera.data.output["normals"].dtype == torch.float
del camera

Expand Down