Skip to content

Add Camera Benchmark Tool and Allow Correct Unprojection of distance_to_camera depth image - #976

Merged
jsmith-bdai merged 54 commits into
isaac-sim:mainfrom
glvov-bdai:feature/tiled_camera_examples
Sep 25, 2024
Merged

jsmith-bdai merged 54 commits into
isaac-sim:mainfrom
glvov-bdai:feature/tiled_camera_examples

Conversation

@glvov-bdai

@glvov-bdai glvov-bdai commented Sep 11, 2024 •

Copy link
Copy Markdown
Contributor

Description

This change allows a user to easily test different camera settings/configurations to see what works best for them.

This also includes a fix to be able to correctly unproject point clouds from the distance_to_camera replicator,
as the unproject_depth method assumes that data originates from distance_to_image_plane replicator and as such could previously result in distortion when previously used with the distance_to_camera replicator.
pyproject.toml

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Screenshots

saved_depth_images_timestep_7

saved_images_timestep_4

Checklist

  • 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

@jsmith-bdai jsmith-bdai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with a few minor comments. Thanks for adding this useful tool 🎉

@glvov-bdai glvov-bdai self-assigned this Sep 23, 2024
@jsmith-bdai

Copy link
Copy Markdown
Contributor

@Mayankm96 @pascal-roth can you guys take another look, I think Gary has addressed most of the changes and this tool is quite useful so it would be good to get it merged to the repo!

@jsmith-bdai jsmith-bdai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New changes LGTM, thanks again!

@Dhoeller19 Dhoeller19 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is cool stuff, thanks @glvov-bdai!

@glvov-bdai
glvov-bdai dismissed stale reviews from Mayankm96 and pascal-roth September 25, 2024 19:13

No activity in a week, need to merge functionality for upstream manager based cartpole PR

@glvov-bdai

glvov-bdai commented Sep 25, 2024 •

Copy link
Copy Markdown
Contributor Author

@Dhoeller19 @kellyguo11 I don't have permission to merge but it's ready do you mind merging this in for me (or giving me the needed access to merge this)? EDIT: smitty got me

@jsmith-bdai
jsmith-bdai merged commit f8d80cb into isaac-sim:main Sep 25, 2024
---------


0.24.14 (2024-09-20)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI: You need to update BOTH extension.toml and CHANGELOG.rst

@torch.jit.script
def unproject_depth(depth: torch.Tensor, intrinsics: torch.Tensor) -> torch.Tensor:
r"""Unproject depth image into a pointcloud.
r"""Unproject depth image into a pointcloud. This method assumes that depth

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please follow google doc-style. The first line here is a one-line sumary. Everything else moves to a new para.

jsmith-bdai added a commit that referenced this pull request Sep 25, 2024
# Description

Adds manager based cartpole vision example environments. 

Also uses the`convert_perspective_depth_to_orthogonal_depth `
functionality introduced in #976 , contains a duplicate copy of the
method and test for completeness of the PR. Will be synced with main to
remove this duplicate copy once #976 is merged into main, or #976 will
be synced with main if this PR is merged first

## Type of change

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Screenshots

![image](https://github.com/user-attachments/assets/4cce3923-b199-4469-b8d0-9d8d8abb3456)

## Checklist

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

## Testing

Training converged in both RGB and Depth at similar rates to the direct
environments

---------

Signed-off-by: garylvov <[email protected]>
Signed-off-by: glvov-bdai <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: James Smith <[email protected]>
def convert_perspective_depth_to_orthogonal_depth(
perspective_depth: torch.Tensor, intrinsics: torch.Tensor
) -> torch.Tensor:
r"""Provided depth image(s) where depth is provided as the distance to the principal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r""" is only used when you have math equations. In all other cases, please resort to double ticks.

The function assumes that the width and height are both greater than 1.

Args:
perspective_depth: The depth measurement obtained with the distance_to_camera replicator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since it is a math util, any mention of replicator does not make sense.

iter_old_quat_rotate_inverse(q_rand, v_rand),
)

def test_depth_perspective_conversion(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please always add a docstring for a test so the description also is visible when you run the test.

#
# SPDX-License-Identifier: BSD-3-Clause

"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommend moving this benchmarking to the benchmark folder instead of tutorials.

iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this pull request Nov 21, 2024
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this pull request Nov 21, 2024
)

# Description

Adds manager based cartpole vision example environments. 

Also uses the`convert_perspective_depth_to_orthogonal_depth `
functionality introduced in isaac-sim#976 , contains a duplicate copy of the
method and test for completeness of the PR. Will be synced with main to
remove this duplicate copy once isaac-sim#976 is merged into main, or isaac-sim#976 will
be synced with main if this PR is merged first

## Type of change

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Screenshots

![image](https://github.com/user-attachments/assets/4cce3923-b199-4469-b8d0-9d8d8abb3456)

## Checklist

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

## Testing

Training converged in both RGB and Depth at similar rates to the direct
environments

---------

Signed-off-by: garylvov <[email protected]>
Signed-off-by: glvov-bdai <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: James Smith <[email protected]>
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
)

# Description

Adds manager based cartpole vision example environments. 

Also uses the`convert_perspective_depth_to_orthogonal_depth `
functionality introduced in isaac-sim#976 , contains a duplicate copy of the
method and test for completeness of the PR. Will be synced with main to
remove this duplicate copy once isaac-sim#976 is merged into main, or isaac-sim#976 will
be synced with main if this PR is merged first

## Type of change

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Screenshots

![image](https://github.com/user-attachments/assets/4cce3923-b199-4469-b8d0-9d8d8abb3456)

## Checklist

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

## Testing

Training converged in both RGB and Depth at similar rates to the direct
environments

---------

Signed-off-by: garylvov <[email protected]>
Signed-off-by: glvov-bdai <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: garylvov <[email protected]>
Co-authored-by: James Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants