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

Port LensFlareSensorPlugin from gazebo-classic to a LensFlare system #1909

Closed
scpeters opened this issue Feb 28, 2023 · 8 comments
Closed

Port LensFlareSensorPlugin from gazebo-classic to a LensFlare system #1909

scpeters opened this issue Feb 28, 2023 · 8 comments
Labels
close the gap Features from Gazebo-classic enhancement New feature or request 🎵 harmonic Gazebo Harmonic help wanted We accept pull requests!

Comments

@scpeters
Copy link
Member

Desired behavior

There is support for lens flares in gazebo-classic (see the lensflare_plugin.world example world). Support for lens flares has been added to gz-rendering's harmonic (main) branch in gazebosim/gz-rendering#730, but in order to use it, we should port the LensFlareSensorPlugin to a gz-sim. It should not be too difficult to implement.

Alternatives considered

Implementation suggestion

Additional context

@scpeters scpeters added enhancement New feature or request help wanted We accept pull requests! close the gap Features from Gazebo-classic 🎵 harmonic Gazebo Harmonic labels Feb 28, 2023
@jasmeet0915
Copy link
Contributor

Hi @scpeters, I would like to work on this issue.

From what I understood one would have to create a LensFlare system plugin in the gz-sim repo which adds the LensFlarePass as a RenderPass for the camera after setting the values (scale, color, and occlusion steps) in the Configure Interface of the plugin. Something like shown in the Test it code snippet of the LensFlare pass PR.

Am I headed in the right direction with this implementation?

@iche033
Copy link
Contributor

iche033 commented Mar 7, 2023

yes that's the right idea. One difference is that the LensFlarePass must be added to the camera in the render thread instead of Configure. As an example, you can take a look at the camera_video_recorder system which is also a sensor plugin.

In this example, the system connects to a render event so all rendering operations are done in the callback function in the render thread.

It retrieves the name of the camera based on its entity id (you should be able to do this in Configure) then use the name to get the rendering camera ptr. You just then need to apply Lens Flare pass to that camera. Afterwards, you are free to disconnect from the render event.

@scpeters
Copy link
Member Author

scpeters commented Mar 7, 2023

Hi @scpeters, I would like to work on this issue.

Hooray! Thanks for volunteering, and please follow Ian's advice as he knows more than I do about this topic.

@jasmeet0915
Copy link
Contributor

Thank you @iche033 for the detailed advice!

please follow Ian's advice as he knows more than I do about this topic.

Sure will do and make a PR as soon as possible!

@jasmeet0915
Copy link
Contributor

@scpeters @iche033 I was able to add the LensFlare System to gz-sim. I have also ported the example sdf from gazebo-classic over to this repo. Here is a snapshot:

Screenshot from 2023-03-12 02-05-09

I am not sure why but the effect was somewhat more prominent in the Wide Angle Camera as compared to others. I'll create a PR soon after adding the integration tests!

@iche033
Copy link
Contributor

iche033 commented Mar 13, 2023

awesome thanks for the work! I'll take a look at the PR once it's up

@jasmeet0915 jasmeet0915 mentioned this issue Mar 16, 2023
16 tasks
@jasmeet0915
Copy link
Contributor

@iche033 the PR is up!

@scpeters
Copy link
Member Author

lens_flare system added in #1933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close the gap Features from Gazebo-classic enhancement New feature or request 🎵 harmonic Gazebo Harmonic help wanted We accept pull requests!
Projects
Archived in project
Development

No branches or pull requests

3 participants