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

Fix multiple reflectance maps and improve performance #2742

Merged
merged 3 commits into from
May 28, 2020

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented May 24, 2020

Changes

  • Fixes issue when there are multiple objects in the scene with different reflectance maps by creating a unique reflectance material for each reflectance map

  • Improves performance by disabling shadows during reflectance render updates.

Testing

Build this branch with gazebo_ros_pkgs noetic-devel branch

Here is a reflectance_test.world for testing. The world consists of 3 depth cameras with depth, normals, reflectance output, and 100 boxes in front of the depth cameras.

For verifying multiple reflectance maps, launch gazebo with the reflectance_test.world:

roslaunch gazebo_ros empty_world.launch verbose:=true world_name:=<path_to_reflectance_test.world>

launch rqt_image_viewer to see data from the reflectance topic:

rqt_image_view /depth_cam/reflectance

You should see two different reflectance maps rendered side by side. Before the changes in the PR, I see two identical reflectances maps.

For testing performance, launch the reflectance_test.world, and see the frame rates using rostopic hz. Subscribe to all 3 depth cameras:

# you can do this in 3 terminals
rostopic hz /depth_cam/image_raw
rostopic hz /depth_cam2/image_raw
rostopic hz /depth_cam3/image_raw

The target framerate is set to 30Hz but the cameras do not hit the target frame rate (which is what we want for testing so we can see the differences in performance). These are the frame rates I get on my laptop before and after the change:

Before:

  • depth;normals;reflectance: 10Hz
  • depth;normals: 19Hz
  • depth;reflectance: 14Hz

After:

  • depth;normals;reflectance: 15Hz
  • depth;normals: 19Hz
  • depth;reflectance: 21Hz

In two cases that refletance is enabled, the frame rate improves by 5~7Hz

Signed-off-by: Ian Chen ichen@osrfoundation.org

Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@iche033
Copy link
Contributor Author

iche033 commented May 24, 2020

cc @ahcorde

@ahcorde
Copy link
Contributor

ahcorde commented May 26, 2020

On my desktop
Before:

  • depth;normals;reflectance: 15Hz

After:

  • depth;normals;reflectance: 23Hz

Changelog.md Outdated
## Gazebo 9.XX.X (20XX-XX-XX)

1. Fix multiple reflectance maps and improve performance
* [Pull request ]()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* [Pull request ]()
* [Pull request](https://github.com/osrf/gazebo/pull/2742/)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated. e6a2f94

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor fix in the changelog

Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@scpeters
Copy link
Member

it looks fine to me. the windows build failure is unrelated

Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@iche033 iche033 merged commit 8086276 into gazebo9 May 28, 2020
@iche033 iche033 deleted the reflectance_fixes branch May 28, 2020 16:53
@iche033 iche033 mentioned this pull request May 28, 2020
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.

None yet

3 participants