Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Ogre2DepthCamera performance by skipping color target passes when there are no connections #965

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jan 25, 2024

🦟 Bug fix

Summary

Performance optimization - Ogre2DepthCamera is capable of generating color images in addition to depth and the color data are packed into a point cloud buffer. So if there are no point cloud connections, we can skip computations needed to generate the color rgb images.

Also added changes to skip light-related computations in the same way as lidars in #955

More info:

This is done by using ogre2's "execution mask". If the render passes execution mask matches the workspace's execution mask, the passes get executed. So by default, the color target's render passes' execution mask is set to something that does not match the workspace execution mask so we can skip computation for the color passes. When point cloud connections is detected, the passes' execution mask is updated to match the workspace's mask.

To Test

This is to be used with gazebosim/gz-sensors#413. You can see graphs in that pull request showing the performance improvements for a depth camera and a RGBD camera in gz sim.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (22eb772) 75.54% compared to head (5b2664e) 75.58%.

Files Patch % Lines
ogre2/src/Ogre2DepthCamera.cc 93.75% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           gz-rendering8     #965      +/-   ##
=================================================
+ Coverage          75.54%   75.58%   +0.03%     
=================================================
  Files                177      177              
  Lines              16890    16919      +29     
=================================================
+ Hits               12760    12788      +28     
- Misses              4130     4131       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iche033 iche033 merged commit 9f5c94a into gz-rendering8 Jan 26, 2024
10 of 11 checks passed
@iche033 iche033 deleted the depth_execution_mask branch January 26, 2024 22:44
iche033 added a commit that referenced this pull request Feb 29, 2024
… when there are no connections (#965)

skip computations needed to generate the color rgb images if there are no point cloud connections.

---------

Signed-off-by: Ian Chen <ichen@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants