-
Notifications
You must be signed in to change notification settings - Fork 59
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
OGRE2: Camera sensor clipping stops working when model is rotated #128
Comments
I think the reason is that for rgbd cameras, we are manually clipping the view ourselves based on depth values in fragment shader and the result is going to be more accurate. While for |
So the solution would be to do the clipping manually in all cases? Or should it be solved in OGRE? Maybe both, with the manual clipping being a transitional feature until OGRE gets fixed? |
I think we maybe able to fix it for the thermal camera as it's using its own custom shaders already. For RGB camera we would probably need to add an extra shader pass for manual clipping. I don't know if this is something that'll be fixed in OGRE 2 though. It could be designed this way for more faster culling of objects in the view and accuracy is not a priority here. |
Okay. Fixing it in ign-rendering would be the faster option. However, my shader programming skills are close to zero, so I can't help sending a PR... |
GPU lidar is also affected and it is pretty bad! Try with CTU_CRAS_NORLAB_SPOT_SENSOR_CONFIG_1 in SubT simulator, or MARV. Robot parallel with world axes: Robot about 30° to world: Robot 45° to world: Yellow points mark those closer than 0.2 m from the sensor. Sensor definition: <sensor name="laser" type="gpu_lidar">
<pose>0 0 0.035925 0 -0 0</pose>
<update_rate>10</update_rate>
<visualize>0</visualize>
<always_on>1</always_on>
<lidar>
<scan>
<horizontal>
<samples>2048</samples>
<resolution>1</resolution>
<min_angle>-3.1459</min_angle>
<max_angle>3.1459</max_angle>
</horizontal>
<vertical>
<samples>128</samples>
<resolution>1</resolution>
<min_angle>-0.785398</min_angle>
<max_angle>0.785398</max_angle>
</vertical>
</scan>
<range>
<min>0.1</min>
<max>50</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0</mean>
<stddev>0.01</stddev>
</noise>
</lidar>
</sensor>
|
That is not an explanation though 😞 . If an object is fully visible at 45° but not at 0° because our culling calculations decided it so, that's a bug. We are not sacrificing accuracy THAT much. But I don't think that is what's happening. |
Environment
Description
Steps to reproduce
LANG=C ign gazebo -v4 occlusion.sdf
This behavior is wrong because the transform between the sensor and the sphere is static. That should apply consistent behavior no matter where the model is located (except lighting).
The scene in the example is as follows: camera is in the origin, sphere with 0.1 radius is located at X axis 0.25 forward. So the sphere occupies X axis from 0.15 to 0.35. Near clip distance is set to 0.4, so the sphere should not be rendered.
OGRE1 handles this case correctly.
This bug manifests not only with simple shapes, but also with meshes. We've faced it with practically all of our SubT models when preparing them. A simple to test one is Marmotte camera_0 (osrf/subt#842).
In the example SDF, setting camera near clip distance to anything higher than 0.35 triggers this bug.
This happens with "camera" and "thermal" type sensors. Types "rgbd" (both color and depth) and "depth" are not affected. The fact that the color camera from "rgbd" sensor is not affected might point to a possible direction of research for this bug...
Output
Aligned with axes:
Rotated:
Minimum Buggy Example
occlusion.sdf:
The text was updated successfully, but these errors were encountered: