Commit aecf9afd authored by matthewtrepte's avatar matthewtrepte Committed by Kelly Guo

Adds unit tests for multi tiled cameras (#241)

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->

Adds initial unit tests for multiple tiled cameras, which had several
bugs/features recently. The unit tests cover existing test cases from
the test_tiled_camera.py and a few new ones, including initialization,
groundtruth annotators, different poses, and different resolutions.

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

<!-- As you go through the list, delete the ones that are not
applicable. -->

- New feature (non-breaking change which adds functionality)

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) 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
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarKelly Guo <kellyguo123@hotmail.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyguo123@hotmail.com>
parent 118201f7
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.33.8"
version = "0.33.9"
# Description
title = "Isaac Lab framework for Robot Learning"
......
Changelog
---------
0.33.8 (2025-01-30)
0.33.9 (2025-01-30)
~~~~~~~~~~~~~~~~~~~
Fixed
......@@ -12,7 +12,7 @@ Fixed
to the event being triggered at the wrong time after the reset.
0.33.7 (2025-01-17)
0.33.8 (2025-01-17)
~~~~~~~~~~~~~~~~~~~
Fixed
......@@ -42,7 +42,7 @@ Fixed
the :class:`omni.isaac.lab.assets.RigidObjectCollection` class.
0.33.6 (2025-01-14)
0.33.7 (2025-01-14)
~~~~~~~~~~~~~~~~~~~
Fixed
......@@ -51,6 +51,15 @@ Fixed
* Fixed the respawn of only wrong object samples in :func:`repeated_objects_terrain` of :mod:`omni.isaac.lab.terrains.trimesh` module. Previously, the function was respawning all objects in the scene instead of only the wrong object samples, which in worst case could lead to infinite respawn loop.
0.33.6 (2025-01-16)
~~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Added initial unit tests for multiple tiled cameras, including tests for initialization, groundtruth annotators, different poses, and different resolutions.
0.33.5 (2025-01-13)
~~~~~~~~~~~~~~~~~~~
......
This diff is collapsed.
......@@ -115,7 +115,7 @@ class TestTiledCamera(unittest.TestCase):
if im_type == "rgb":
self.assertEqual(im_data.shape, (1, self.camera_cfg.height, self.camera_cfg.width, 3))
self.assertGreater((im_data / 255.0).mean().item(), 0.0)
elif im_type == "depth":
elif im_type == "distance_to_camera":
self.assertEqual(im_data.shape, (1, self.camera_cfg.height, self.camera_cfg.width, 1))
self.assertGreater(im_data.mean().item(), 0.0)
del camera
......@@ -278,7 +278,7 @@ class TestTiledCamera(unittest.TestCase):
self.assertEqual(im_data.shape, (num_cameras, self.camera_cfg.height, self.camera_cfg.width, 3))
for i in range(4):
self.assertGreater((im_data[i] / 255.0).mean().item(), 0.0)
elif im_type == "depth":
elif im_type == "distance_to_camera":
self.assertEqual(im_data.shape, (num_cameras, self.camera_cfg.height, self.camera_cfg.width, 1))
for i in range(4):
self.assertGreater(im_data[i].mean().item(), 0.0)
......@@ -1316,7 +1316,7 @@ class TestTiledCamera(unittest.TestCase):
if im_type == "rgb":
self.assertEqual(im_data.shape, (1, camera_cfg.height, camera_cfg.width, 3))
self.assertGreater((im_data / 255.0).mean().item(), 0.0)
elif im_type == "depth":
elif im_type == "distance_to_camera":
self.assertEqual(im_data.shape, (1, camera_cfg.height, camera_cfg.width, 1))
self.assertGreater(im_data.mean().item(), 0.0)
del camera
......@@ -1459,7 +1459,7 @@ class TestTiledCamera(unittest.TestCase):
# check difference is above threshold
self.assertGreater(
torch.abs((image_after - image_before).mean()), 0.05
torch.abs(image_after - image_before).mean(), 0.05
) # images of same color should be below 0.001
def test_frame_offset_large_resolution(self):
......@@ -1504,7 +1504,7 @@ class TestTiledCamera(unittest.TestCase):
# check difference is above threshold
self.assertGreater(
torch.abs((image_after - image_before).mean()), 0.05
torch.abs(image_after - image_before).mean(), 0.05
) # images of same color should be below 0.001
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment