Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

FSAA for Wide Angle Camera #2261

Closed
osrf-migration opened this issue Apr 29, 2017 · 3 comments
Closed

FSAA for Wide Angle Camera #2261

osrf-migration opened this issue Apr 29, 2017 · 3 comments
Labels
7 Gazebo 7 bug Something isn't working minor rendering

Comments

@osrf-migration
Copy link

Original report (archived issue) by Andrew Symington (Bitbucket: asymingt).


I tried to create a wide angle camera sensor in my VM and encountered this crash:

[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]
[ INFO] [1493423742.569698185, 0.154000000]: waitForService: Service [/honey/framestore_manager/load_nodelet] is now available.
gzserver: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp:546: virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*): Assertion `bAttached && "A new DepthBuffer for a RenderTarget was created, but after creation" "it says it's incompatible with that RT"' failed.

Thread 1 "gzserver" received signal SIGABRT, Aborted.
0x00007ffff6afc428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6afc428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6afe02a in __GI_abort () at abort.c:89
#2  0x00007ffff6af4bd7 in __assert_fail_base (fmt=<optimized out>, 
    assertion=assertion@entry=0x7fffef978f68 "bAttached && \"A new DepthBuffer for a RenderTarget was created, but after creation\" \"it says it's incompatible with that RT\"", 
    file=file@entry=0x7fffef978bf0 "/build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp", 
    line=line@entry=546, 
    function=function@entry=0x7fffef978940 "virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*)") at assert.c:92
#3  0x00007ffff6af4c82 in __GI___assert_fail (
    assertion=0x7fffef978f68 "bAttached && \"A new DepthBuffer for a RenderTarget was created, but after creation\" \"it says it's incompatible with that RT\"", file=0x7fffef978bf0 "/build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp", 
    line=546, function=0x7fffef978940 "virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*)") at assert.c:101
#4  0x00007fffef7581b8 in Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#5  0x00007fff8827707e in Ogre::GLRenderSystem::_setRenderTarget(Ogre::RenderTarget*) ()
   from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so
#6  0x00007fff88273605 in Ogre::GLRenderSystem::_setViewport(Ogre::Viewport*) ()
   from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so
#7  0x00007fffef6ad7f8 in Ogre::SceneManager::setViewport(Ogre::Viewport*) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#8  0x00007fffef6c30fc in Ogre::SceneManager::_renderScene(Ogre::Camera*, Ogre::Viewport*, bool) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#9  0x00007fffef6fff51 in Ogre::Camera::_renderScene(Ogre::Viewport*, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#10 0x00007fffef6a477a in Ogre::RenderTarget::_updateViewport(Ogre::Viewport*, bool) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#11 0x00007fffef6a45cb in Ogre::RenderTarget::_updateAutoUpdatedViewports(bool) ()
   from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#12 0x00007fffef6a411e in Ogre::RenderTarget::updateImpl() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#13 0x00007fffef6a4ac4 in Ogre::RenderTarget::update(bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#14 0x00007fffefe4d6a3 in gazebo::rendering::WideAngleCamera::RenderImpl() () from /usr/lib/x86_64-linux-gnu/libgazebo_rendering.so.7
#15 0x00007fffefd4bf8c in gazebo::rendering::Camera::Render(bool) () from /usr/lib/x86_64-linux-gnu/libgazebo_rendering.so.7
#16 0x00007ffff6827177 in gazebo::sensors::CameraSensor::Render() () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#17 0x00007ffff686e67a in ?? () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#18 0x00007ffff6869123 in gazebo::sensors::SensorManager::ImageSensorContainer::Update(bool) ()
   from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#19 0x00007ffff6869a34 in gazebo::sensors::SensorManager::Update(bool) () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#20 0x00007ffff7ba4ae0 in gazebo::Server::Run() () from /usr/lib/x86_64-linux-gnu/libgazebo.so.7
#21 0x0000000000402e68 in ?? ()
#22 0x00007ffff6ae7830 in __libc_start_main (main=0x402d70, argc=10, argv=0x7fffffffd1d8, init=<optimized out>, 
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd1c8) at ../csu/libc-start.c:291

I believe this might be related to issue #1837.

For my Xenial/Kinetic/Ogre1.9 environment, the FSAA= 4 on line 639 in functionWideAngleCamera::CreateEnvRenderTexture in file gazebo/gazebo/rendering/WideAngleCamera.cc. Should it not be set to zero?

@osrf-migration
Copy link
Author

Original comment by Andrew Symington (Bitbucket: asymingt).


I can confirm that setting fsaa=0 fixes the segfault. However, the resulting camera does not appear to render the scene correctly in a VM environment.

For example, here is what a regular camera looks like:

camera.png

And here is what the wide angle camera looks like

wideangle.png

This is the SDF I am using for the wide angle camera.

#!sdf
    <sensor name="nav_cam" type="wideanglecamera">
      <pose>0 0 0 0 0 0</pose>
      <always_on>1</always_on>
      <update_rate>3.5</update_rate>
      <visualize>0</visualize>
      <camera>
        <horizontal_fov>2.26893</horizontal_fov> <!-- 130 degrees -->
        <image>
          <width>1280</width>
          <height>960</height>
          <format>L8</format>
        </image>
        <clip>
          <near>0.1</near>
          <far>10</far>
        </clip>
      </camera>
    </sensor>

@osrf-migration
Copy link
Author

Original comment by Andrew Symington (Bitbucket: asymingt).


Right, so I worked out that the issue with offscreen rendering of the wide-angle camera happens because the GLSL script used to apply the distortion demanded a minimum GLSL version of 130. I bumped this down to 120, and it seems as though everything stills works correctly.

Here is a screenshot of a monochrome wide angle camera working correctly in a VM context:

fixed.png

My fixes are in pull request #2698.

@osrf-migration
Copy link
Author

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


  • changed state from "new" to "resolved"

@osrf-migration osrf-migration added minor rendering bug Something isn't working 7 Gazebo 7 labels Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
7 Gazebo 7 bug Something isn't working minor rendering
Projects
None yet
Development

No branches or pull requests

1 participant