-
Notifications
You must be signed in to change notification settings - Fork 479
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
Wideanglecamera equidistant mapping bounding fix #3135
Wideanglecamera equidistant mapping bounding fix #3135
Conversation
@@ -1515,7 +1515,7 @@ fragment_program Gazebo/WideLensMapFS glsl | |||
param_named c2 float 1 | |||
param_named c3 float 0 | |||
param_named f float 1 | |||
param_named fun float3 0 1 | |||
param_named fun float3 0 0 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line might not change anything, but it seemed odd to not complete the default float3 values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If float3 0 1
was working before, wouldn't Ogre have been interpreting it as float3 0 1 0
? This looks like it would change behavior from using atan(param)
to using param
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this is suspicious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be 0 0 1
to match the default fun
value of id
specified here (which is defined to be UnitZ
here.)
It may not matter that much though as the values specified here in the material script are the initial values but should be overriden every frame by the SetUniformVariables call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! looks good to me
@@ -1515,7 +1515,7 @@ fragment_program Gazebo/WideLensMapFS glsl | |||
param_named c2 float 1 | |||
param_named c3 float 0 | |||
param_named f float 1 | |||
param_named fun float3 0 1 | |||
param_named fun float3 0 0 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be 0 0 1
to match the default fun
value of id
specified here (which is defined to be UnitZ
here.)
It may not matter that much though as the values specified here in the material script are the initial values but should be overriden every frame by the SetUniformVariables call
Currently when using a
wideanglecamera
sensor with a lens type ofequidistant
, the actual image data gets restricted to a small circular region with the rest of the image having a gray ring around it. See the images below for the image that is produced for anequidistant
lens with an HFOV of 1.5708, 2.0, and 3.14159.The issue appears to be in
wide_lens_map_fp.glsl
on Line 38. The valuetheta
gets calculated withasin(param)
driving the equation iffun.x
is 1 (which is true forequisolid_angle
andorthographic
lens types). The way this equation is written becomes problematic for other lens types, though, when theparam > 1
since the resulting value ofasin(param)
becomes undefined.This PR is to add a check for function type to avoid the undefined
asin
computation. See the images below for anequidistant
lens with an HFOV of 1.5708, 2.0, and 3.14159 after this fix.