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

Distortion::RefreshCompositor check nonzero params #3071

Merged

Conversation

scpeters
Copy link
Member

There is a small regression from the fix in #3060 when a camera has a <distortion/> block containing k and p parameters with all 0 values like the following:

            <distortion>
              <k1>0</k1>
              <k2>0</k2>
              <k3>0</k3>
              <p1>0</p1>
              <p2>0</p2>
              <center>0.5 0.5</center>
            </distortion>

In this case, the Distortion::SetCamera method will be called because the camera contains a <distortion/> element, but SetCamera will return early without creating a compositor instance. For consistency, add the same check to the RefreshCompositor method, otherwise a compositor will be added without any of the configuration done in SetCamera.

The SetCamera method returns early without creating a
compositor instance if the k and p parameters are all
close to zero. For consistency, add the same check to
the RefreshCompositor method.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters merged commit e8d7b56 into gazebosim:gazebo11 Aug 24, 2021
@scpeters scpeters deleted the distortion_refresh_check_zeros branch August 24, 2021 22:51
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.

2 participants