Skip to content

Conversation

@Rabbit-Hu
Copy link
Contributor

@Rabbit-Hu Rabbit-Hu commented Dec 18, 2025

Description

Fix a bug with TiledCamera. The 4-th channel in the "normals" annotator output should be discarded before reshaping into [B, H, W, 3]. Please find more details in the issue below:

Fixes #4239

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Before After
camera_visualization_before camera_visualization_fixed

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks 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
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions bot added the isaac-lab Related to Isaac Lab team label Dec 18, 2025
@Rabbit-Hu
Copy link
Contributor Author

Hi reviewers! I wonder if I need to (and how to) create tests and/or update the changelog for this bug fix.

@Rabbit-Hu Rabbit-Hu marked this pull request as ready for review December 18, 2025 01:46
Copy link
Contributor

@Mayankm96 Mayankm96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix! Could we also modify the unit tests to capture this case?

@Mayankm96 Mayankm96 changed the title Fix Bug: incorrect normals in TiledCamera Fixes returned tensor for normals in TiledCamera Dec 18, 2025
@Mayankm96 Mayankm96 added the bug Something isn't working label Dec 18, 2025
@Mayankm96 Mayankm96 moved this to In review in Isaac Lab Dec 18, 2025
@Rabbit-Hu Rabbit-Hu mentioned this pull request Dec 19, 2025
4 tasks
@Rabbit-Hu
Copy link
Contributor Author

Hi @Mayankm96 , thank you for your reply! I am happy to update the unit tests, but unfortunately I have run into issues running the unit tests for TiledCamera (#4255).

@Rabbit-Hu Rabbit-Hu requested a review from Mayankm96 December 21, 2025 01:10
@Rabbit-Hu
Copy link
Contributor Author

Hi @Mayankm96 ! I have updated the unit test to capture the previous bug.

I added an assertion to verify that the norms of the normals should be approximately 1. The previous (buggy) version would fail here because of the shift.

image

I also updated several existing assertions for the camera data keys in other test cases for TiledCamera, as my fix added a new key normals_padded to the data dict.

I have verified that the fixed code can pass all test cases in the updated unit tests in test_tiled_camera.py.

@ooctipus
Copy link
Collaborator

ooctipus commented Dec 21, 2025

If I understand the issue correctly, the fix is discarding the fourth channel before reshaping. But I see implementation added a new output_type called normal_padded, is that needed?

@Rabbit-Hu
Copy link
Contributor Author

Hi @ooctipus , thank you.

I just realized that adding a new output key was indeed unnecessary. I changed it to a simpler fix.

The unit test has been updated accordingly, capturing the previous bug without making unnecessary changes.

@Mayankm96
Copy link
Contributor

Mayankm96 commented Dec 28, 2025

Thank you for the fix!

@Mayankm96 Mayankm96 merged commit 0d2cd1c into isaac-sim:main Dec 28, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in Isaac Lab Dec 28, 2025
thiagolages pushed a commit to thiagolages/isaac-lab that referenced this pull request Jan 6, 2026
# Description

<!--
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

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

<!--Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.-->

Fix a bug with `TiledCamera`. The 4-th channel in the "normals"
annotator output should be discarded before reshaping into [B, H, W, 3].
Please find more details in the issue below:

Fixes isaac-sim#4239

<!-- 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. -->

## Type of change

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

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

| Before | After |
| ------ | ----- |
| <img width="1512" height="742" alt="camera_visualization_before"
src="https://github.com/user-attachments/assets/fc4470ea-69c1-4012-a711-164b3c23c9a8"
/>| <img width="1512" height="742" alt="camera_visualization_fixed"
src="https://github.com/user-attachments/assets/22019531-91e1-4614-8418-53fca716dfec"
/>|

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] 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
-->

---------

Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug Report] TiledCamera outputs incorrect normals data due to buffer shift

4 participants