VMWare rendering: Z Ordering Appears Random

Issue #1837 closed
Xander Dunn created an issue

We have two simulations in Gazebo: A pendulum and an acrobot.

We have the simulations arranged such that the arms are facing the camera. However, at runtime it appears random what ordering the links are actually rendered at. Without making any changes, if the simulation is started many times, each run of the simulation will start with an unpredictable ordering.

From one run, here you can see a pendulum with an expected ordering:

img_1000.png

The black link of the pendulum is in front of the brown post.

Randomly, on different runs, we'll see the opposite configuration, where the black link is rendered behind the brown post:

img_1000.png

With an acrobot, that has more parts in the Z direction, there end up being more unpredictable outcomes. Here's one example:

screen_shot_2016-01-19_at_11.20.58_am_720.png

The dark blue link is the top link (drawn behind the post). The bottom link is light blue, drawn in front of the post. This configuration of parts is physically impossible.

Comments (64)

  1. Xander Dunn reporter

    Here is a simple scene where we reproduce the problem. It's a table, bookshelf, and soda can. In this screenshot of the Gazebo GUI, you can see the scene rendered properly:

    screen_shot_2016-01-19_at_12.53.38_pm_720.png

    The soda can is closest to the camera, the bookshelf is next, and finally a table is furthest away from the camera.

    However, when this scene is captured as an image through the in-scene camera object, it's not rendered correctly:

    default_camera_link_camera_1_-0330_360.jpg

    The objects don't seem to be in the correct order. The table certainly shouldn't be seen going through the bookshelf.

    Note that the examples I showed above of the pendulum and acrobot were also using the in-scene camera.

    Thanks!

  2. Steven Peters

    which version of gazebo are you using? I just tried opening that world with the latest version of gazebo built from source, and it doesn't have this error (actually I modified the camera position slightly so the camera visual wouldn't overlap the bookshelf)

    I wonder if the OS / video card / video driver may have an effect as well

    cam_z_order.png

    --- cam-1.world 2016-01-19 13:37:02.747699128 -0800
    +++ cam.world   2016-01-19 13:33:44.151699221 -0800
    @@ -517,7 +517,7 @@
             <self_collide>0</self_collide>
             <kinematic>0</kinematic>
           </link>
    -      <pose frame=''>0.667547 -3.42521 0 0 -0 0</pose>
    +      <pose frame=''>0.667547 -3.6 0 0 -0 0</pose>
         </model>
         <state world_name='default'>
           <sim_time>449 441000000</sim_time>
    @@ -555,10 +555,10 @@
             </link>
           </model>
           <model name='camera'>
    -        <pose frame=''>0.667547 -3.42521 0.22092 -0.018695 -0.149607 1.51876</pose>
    +        <pose frame=''>0.667547 -3.6 0.22092 -0.018695 -0.149607 1.51876</pose>
             <scale>1 1 1</scale>
             <link name='link'>
    -          <pose frame=''>0.618881 -3.38049 0.276881 -0.018695 -0.149607 1.51876</pose>
    +          <pose frame=''>0.618881 -3.55 0.276881 -0.018695 -0.149607 1.51876</pose>
               <velocity>0 0 0 0 -0 0</velocity>
               <acceleration>0 0 0 0 -0 0</acceleration>
               <wrench>0 0 0 0 -0 0</wrench>
    
  3. Xander Dunn reporter

    Thanks for testing! We're using ROS Indigo, so we're using the compatible Gazebo 2.

    The issue is identical across three different setups: Mac OSX 10.11 MacBook Pro, Ubuntu 14.04 MacBook Pro, and Ubuntu 14.04 AWS c4 instances.

    It's strange that it always renders correctly in the Gazebo GUI but often not in scene camera output.

    Considering the age of gazebo 2 and the fact that it doesn't reproduce on latest, perhaps it's since been fixed. We're hoping to figure out some solution for current stable ROS.

  4. Daniele E. Domenichelli

    I cannot reproduce it all the times, but I can confirm this bug on gazebo 6.5.1 on ubuntu trusty from the repository (6.5.1-1~trusty).

    Here's a couple of screenshots

    Screenshot from 2016-01-21 07^%25^%01.png

    gazebo_issue_1837.png

  5. Nate Koenig

    Your problem may be associated with vmware. We have never had great experiences using virtual machines and offscreen rendering.

  6. Ian Chen

    I've also been testing this but couldn't reproduce the problem. z-ordering.png

    It could be what @nkoenig said about problem with running gazebo in a VM. Otherwise, what graphics card and driver are you using? Gazebo has been tested most on nvidia cards.

  7. Xander Dunn reporter

    Many thanks @iche033, @nkoenig, and @drdanz for your input.

    Yes, we were able to reproduce the issue in Gazebo 6.5.1 on Trusty. We are indeed running Gazebo in a virtual machine. We've tried in both VMWare and VirtualBox. In Virtual Box we used a virtual frame buffer with software GL. In VMWare we used the driver provided by VMWare.

    We can try running it on a physical Ubuntu machine, but ultimately this will be a problem for high performance computing since we deploy everything as Docker containers onto Amazon Web Services machines.

    As @drdanz noticed, we don't see this all the time. We see it in approximately half of our runs, where a single run consists of starting up Gazebo a single time. Any given run will either always or never show the issue.

  8. Steven Peters

    There are AWS instances with GPU's that we have used with gazebo, though they are more expensive. @hugomatic know the most on this subject.

  9. Xander Dunn reporter

    Testing locally on a MacBook Pro with an nvidia card running Gazebo in VMWare with graphics acceleration still shows the issue, so the AWS instance type alone isn't likely to solve it.

  10. Xander Dunn reporter

    Yes, we will test running it directly, outside of the virtual machine. The difficulty is scaling this across tens of thousands of Amazon runs. Everything inside virtual machines is the standard practice.

  11. Christian Rose

    I would like to add, that I have this issue also with gazebo6 running native in ubuntu 14.04.

    So from my side, the virtual machine is not the problem. The exact setup is working on my second laptop with out problems. Maybe there is so issue with the gpu used.

    Here is a picture from gazebo:

    gazebo6.png

    And this is the display from rviz:

    rviz.png

    As you can see the blue barrel is missing and the floor looks strange.

  12. Steven Peters

    @toxcjr can you describe your hardware setup that has this problem? You said it is running Ubuntu natively; what is the video card and driver? Also, perhaps the output of glxinfo?

  13. Christian Rose

    Hi.

    I'm running ubuntu 14.04 native on a toshiba laptop:

    • CPU: Intel® Core™ i5 CPU M 520
    • GPU: Intel® Ironlake Mobile
    • RAM: 8GB

    This is the glxinfo output:

    name of display: :0
    display: :0  screen: 0
    direct rendering: Yes
    server glx vendor string: SGI
    server glx version string: 1.4
    server glx extensions:
        GLX_ARB_create_context, GLX_ARB_create_context_profile, 
        GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
        GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
        GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
        GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
        GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
        GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
    client glx vendor string: Mesa Project and SGI
    client glx version string: 1.4
    client glx extensions:
        GLX_ARB_create_context, GLX_ARB_create_context_profile, 
        GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
        GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
        GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, 
        GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
        GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
        GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
        GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
        GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
        GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
        GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
        GLX_SGI_swap_control, GLX_SGI_video_sync
    GLX version: 1.4
    GLX extensions:
        GLX_ARB_create_context, GLX_ARB_create_context_profile, 
        GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, 
        GLX_ARB_get_proc_address, GLX_ARB_multisample, 
        GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
        GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
        GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
        GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
        GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
        GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
        GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
        GLX_SGI_swap_control, GLX_SGI_video_sync
    OpenGL vendor string: Intel Open Source Technology Center
    OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
    OpenGL version string: 2.1 Mesa 10.3.2
    OpenGL shading language version string: 1.20
    OpenGL extensions:
        GL_3DFX_texture_compression_FXT1, GL_AMD_performance_monitor, 
        GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_trinary_minmax, 
        GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
        GL_APPLE_object_purgeable, GL_APPLE_packed_pixels, 
        GL_APPLE_vertex_array_object, GL_ARB_ES2_compatibility, 
        GL_ARB_buffer_storage, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, 
        GL_ARB_color_buffer_float, GL_ARB_compressed_texture_pixel_storage, 
        GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_debug_output, 
        GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, 
        GL_ARB_draw_buffers, GL_ARB_draw_elements_base_vertex, 
        GL_ARB_draw_instanced, GL_ARB_explicit_attrib_location, 
        GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, 
        GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, 
        GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
        GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
        GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, 
        GL_ARB_instanced_arrays, GL_ARB_internalformat_query, 
        GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, 
        GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample, 
        GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, 
        GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, 
        GL_ARB_provoking_vertex, GL_ARB_robustness, GL_ARB_sampler_objects, 
        GL_ARB_seamless_cube_map, GL_ARB_seamless_cubemap_per_texture, 
        GL_ARB_separate_shader_objects, GL_ARB_shader_bit_encoding, 
        GL_ARB_shader_objects, GL_ARB_shader_texture_lod, 
        GL_ARB_shading_language_100, GL_ARB_shadow, GL_ARB_sync, 
        GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
        GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, 
        GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 
        GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
        GL_ARB_texture_float, GL_ARB_texture_mirror_clamp_to_edge, 
        GL_ARB_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two, 
        GL_ARB_texture_query_lod, GL_ARB_texture_rectangle, GL_ARB_texture_rg, 
        GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_storage, GL_ARB_texture_swizzle, 
        GL_ARB_transpose_matrix, GL_ARB_vertex_array_bgra, 
        GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, 
        GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, 
        GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, 
        GL_ARB_window_pos, GL_ATI_blend_equation_separate, GL_ATI_draw_buffers, 
        GL_ATI_separate_stencil, GL_ATI_texture_env_combine3, 
        GL_ATI_texture_float, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
        GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
        GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array, 
        GL_EXT_copy_texture, GL_EXT_draw_buffers2, GL_EXT_draw_instanced, 
        GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, 
        GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, 
        GL_EXT_gpu_program_parameters, GL_EXT_multi_draw_arrays, 
        GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, 
        GL_EXT_pixel_buffer_object, GL_EXT_point_parameters, 
        GL_EXT_polygon_offset, GL_EXT_provoking_vertex, GL_EXT_rescale_normal, 
        GL_EXT_secondary_color, GL_EXT_separate_specular_color, 
        GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, 
        GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, 
        GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, 
        GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, 
        GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, 
        GL_EXT_texture_env_add, GL_EXT_texture_env_combine, 
        GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, 
        GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_object, 
        GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, 
        GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, 
        GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_vertex_array, 
        GL_EXT_vertex_array_bgra, GL_IBM_multimode_draw_arrays, 
        GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat, 
        GL_INGR_blend_func_separate, GL_INTEL_performance_query, GL_KHR_debug, 
        GL_MESA_pack_invert, GL_MESA_texture_signed_rgba, GL_MESA_window_pos, 
        GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp, 
        GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, 
        GL_NV_primitive_restart, GL_NV_texgen_reflection, 
        GL_NV_texture_env_combine4, GL_NV_texture_rectangle, GL_OES_EGL_image, 
        GL_OES_read_format, GL_S3_s3tc, GL_SGIS_generate_mipmap, 
        GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, 
        GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays
    
    OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.3.2
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
    OpenGL ES profile extensions:
        GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
        GL_APPLE_texture_max_level, GL_EXT_blend_minmax, 
        GL_EXT_discard_framebuffer, GL_EXT_map_buffer_range, 
        GL_EXT_multi_draw_arrays, GL_EXT_read_format_bgra, 
        GL_EXT_separate_shader_objects, GL_EXT_texture_compression_dxt1, 
        GL_EXT_texture_filter_anisotropic, GL_EXT_texture_format_BGRA8888, 
        GL_EXT_texture_rg, GL_EXT_texture_type_2_10_10_10_REV, 
        GL_EXT_unpack_subimage, GL_INTEL_performance_query, GL_NV_draw_buffers, 
        GL_NV_fbo_color_attachments, GL_NV_read_buffer, GL_OES_EGL_image, 
        GL_OES_EGL_image_external, GL_OES_compressed_ETC1_RGB8_texture, 
        GL_OES_depth24, GL_OES_depth_texture, GL_OES_element_index_uint, 
        GL_OES_fbo_render_mipmap, GL_OES_get_program_binary, GL_OES_mapbuffer, 
        GL_OES_packed_depth_stencil, GL_OES_rgb8_rgba8, 
        GL_OES_standard_derivatives, GL_OES_stencil8, GL_OES_surfaceless_context, 
        GL_OES_texture_3D, GL_OES_texture_npot, GL_OES_vertex_array_object
    
    12 GLX Visuals
        visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
      id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
    ----------------------------------------------------------------------------
    0x020 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x021 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x078 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x079 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x07a 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x07b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
    0x07c 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x07d 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x07e 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x07f 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x080 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
    0x05f 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    
    24 GLXFBConfigs:
        visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
      id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
    ----------------------------------------------------------------------------
    0x060  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
    0x061  0 tc  0  16  0 r  . .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
    0x062  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x063  0 tc  0  16  0 r  . .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x064 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x065 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x066 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x067 24 tc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x068  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x069  0 tc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0 16 16 16  0  0 0 Slow
    0x06a 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x06b 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
    0x06c  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
    0x06d  0 dc  0  16  0 r  . .   5  6  5  0 .  .  0  0  0  0  0  0  0  0 0 None
    0x06e  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x06f  0 dc  0  16  0 r  . .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x070 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x071 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0  0  0  0  0  0  0  0 0 None
    0x072 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x073 24 dc  0  32  0 r  . .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x074  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0  0  0  0  0  0 0 None
    0x075  0 dc  0  16  0 r  y .   5  6  5  0 .  .  0 16  0 16 16 16  0  0 0 Slow
    0x076 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  0 0 None
    0x077 24 dc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 Slow
    

    lshw -c video | grep 'configuration' gives:

    configuration: driver=i915 latency=0
    

    So i would say the system uses the intel i915 driver.

    Let me know what you need more.

  14. Christian Rose

    Hi,

    is there anything I can do to get further help with this issue? Please let me know.

    Best regards

    Christian

  15. Ian Chen

    looking at your screenshot, is the blue barrel completely gone (even when viewed from the other side of the wall) or is it the z-ordering problem?

  16. Christian Rose

    It is a z-ordering problem.

    I placed the robot on the other side and checked the blue barrel. The result is this:

    rviz.png

    With the robot facing the lower barrel in this setup:

    gazebo.png

    As you can see the blue barrel is not visible in the image shown in rviz.

    As next step I removed the wall in front of the robot. This is the view in gazebo:

    gazebo2.png

    The output in rviz shows this:

    rviz2.png

    So the blue barrel is not gone, the ordering of the objects is wrong.

    Hope this helps.

  17. Xander Dunn reporter

    One of our engineers discovered that setting fsaa to 0 in Camera::CreateRenderTexture (gazebo/rendering/Camera.cc) solves the Z ordering problem for us using software driver in a virtual machine for both Gazebo 6.5.1 and 7.0.0.

    Before:

    screen_shot_2016-04-08_at_6.09.37_pm_1024.png

    After setting fsaa to 0:

    screen_shot_2016-04-08_at_6.12.56_pm_1024.png

  18. Ian Chen

    That's a good find, thanks for letting us know! Sorry haven't been able to spend much time digging into this issue.

    I'll look into exposing the fsaa setting via a public function like SetFSAA. Later on maybe we'll think about letting user configure various graphics properties in sdf.

  19. Shridhar Shah

    I was also facing the same issue. This is the link to my post.

    Thanks for providing a solution. I tried to build Gazebo 2.2.6 (as it ships with ROS Indigo, which I am trying to fix) with the above change but it did not resolve the issue. Is it possible that his resolution only works in newer versions of gazebo?

  20. Ian Chen

    @scpeters ok

    @sk1234 Not sure. You can give it a try on gazebo versions 5 or above. If that works for you, I'll implement the workaround.

  21. Ryan McNulty

    @iche033, do you have any updates on this? I am seeing the same problem as @sk1234 on Gazebo 7.0.0 from the PPA.

    For my application, I don't think I would be able to compile from source. It would be nice to be able to set fsaa from the urdf/sdf file.

    Thanks!

  22. Ian Chen

    @rmmcnulty9 I was hoping another person with vmware setup can confirm that setting FSAA will fix the problem. @sk1234 mentioned that it didn't work for him so I didn't implement the change..

  23. Sharvashish Das

    I am running Ubuntu16.04 with ROS-kinetic and Gazebo7 on a virtual machine. When I tried to add a camera sensor, the gazebo server would crash with error

    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.

    While finding out the cause for this I saw this link, which forwarded me to this z-ordering issue. I tried setting fsaa to 0, and the issue got resolved. But in my application I would prefer if I could set the fsaa to 0 from sdf file.

    I also tried the same experiment in ROS-indigo with Ubuntu-14.04 and gazebo 6, and gazebo server doesn't crash while I added a camera sensor (without setting fsaa to 0). I guess, since gazebo 6 uses ogre-1.8 while gazebo7 uses ogre-1.9, somehow ogre-1.9 is causing problems with fsaa.

  24. wowo

    @iche033 and @SRV_kgp ,Thank you so much.As my computer is so slow,i finish the make of gazebo until now.It spends my a whole day.But i'm so happy that the gazebo run normally with a camera sensor now.Thanks!

  25. vkpetkov

    Is there any way for a step by step guide on how to change the setting, because I am not able to see the Camera.cc file. Is it at all possible on an installed gazebo? Is it the case not having an installed gazebo and that you have to compile it from source? If so any links to tutorials which might be useful? I am quite new to linux and gazebo. Thanks in advance.

  26. Jariullah Safi

    @vkpetkov You would need to recompile Gazebo from source. I am currently attempting to do that inside an Ubuntu 14.04 VM and I am following the instructions here but there are a lot of packages that are not in the 14.04 repos so I need to compile them from source (e.g. ign-msgs and ign-transport). The fixed mention doesn't seem to hold for old versions of Gazebo (e.g. 2.2).

    I will post back with my experience in the next few hours.

  27. Jariullah Safi

    Hi all. I can confirm that setting fsaa to 0 in the latest version (8.0.0) and compiling that on Ubuntu 14.04 alongside ROS Indigo running in VMware DOES fix the depth ordering issue!

    As a sanity check, leaving the fsaa value at 4 and recompiling reintroduces the issue.

  28. Ian Chen

    @safijari if you have time, could you try something for me?

    I have a branch called fsaa_support to detect fsaa support and print them out to console. My hypothesis for the problem with depth ordering is that we're setting an fsaa value that's not supported. Running gazebo from the fsaa_support branch and inserting a camera on my machine gave me this output:

     FSAA: 0
     FSAA: 16
     FSAA: 2
     FSAA: 4
     FSAA: 8
    ---
     FSAA: 0
     FSAA: 16
     FSAA: 2
     FSAA: 4
     FSAA: 8
    ---
    

    So the default value we're setting in gazebo, 4, is supported so I don't have any depth ordering issue. I am interested to know what the output is for gazebo in VMWare. If 4 also exists there then the problem is somewhere else...

  29. Jariullah Safi

    I can try this tomorrow and let you know.

    @iche033 Using the default branch and copying your additions into Camera.cc I get the following output when adding a camera to Gazebo

    FSAA: 0
    ---
    FSAA: 0
    ---
    

    (this was on Ubuntu 14.04 alongside ROS Indigo in VMware)

    So it would appear your hunch is correct. One comment I have though: we see a similar problem in Gazebo2 on VMware but I could not find any overt references to fsaa in there. Am I missing something? Is fsaa being set somewhere else?

  30. Ian Chen

    ok thanks, I'll implement the fix!

    I'll see if I can provide workarounds for people who are not compiling from source.

  31. Jariullah Safi

    Sounds good, I can write a quick post for compiling from source too (instructions here don't work for 14.04).

    @vkpetkov what is your environment? (linux version, ROS or no ROS, version of ROS, etc).

  32. Jariullah Safi

    @sk1234 I just tested the fix for Gazebo 2.2 from an Indigo install and it works for me. Do you still need a fix for this?

  33. Jariullah Safi

    Instructions for compiling from source (and potentially useful easier fix) here for those using Ubuntu 14.04 with ROS Indigo and the stock Gazebo 2.

  34. vkpetkov

    For me Gazebo 2 was not running with 3D Acceleration in VMWare at all whereas 7 was OK. But I fixed it by following the advice of Hugo Rodde:

    "I had the same issue trying to use Gazebo along with ROS."

    My solution was to downgrade OpenGL from 3.3 to 2.1 as written here: http://www.mesa3d.org/vmware-guest.html

    Info: Ubuntu 14.04 VMware Fusion 8

    [quote] OpenGL 3.3 support can be disabled by setting the environment variable SVGA_VGPU10=0. You will then have OpenGL 2.1 support. This may be useful to work around application bugs (such as incorrect use of the OpenGL 3.x core profile). [/quote]

    So do the following: $ echo "export SVGA_VGPU10=0" >> ~/.bashrc

    I will have to check whether this helps with the z-rendering error in gazebo 2.

  35. Jariullah Safi

    That unfortunately does not fix the problem for Gazebo 2 (Ubuntu 14.04) on my end unfortunately. I also tried it with Gazebo 7 (Ubuntu 16.04, alongside Kinetic) and I get the following error

    [gazebo-1] process has died [pid 11484, exit code 255, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /opt/ros/kinetic/share/turtlebot_gazebo/worlds/playground.world __name:=gazebo __log:=/home/user/.ros/log/1a03a512-7c1c-11e6-89e0-000c29240c4b/gazebo-1.log].
    log file: /home/user/.ros/log/1a03a512-7c1c-11e6-89e0-000c29240c4b/gazebo-1*.log
    

    Unfortunately the mentioned log file doesn't seem to exist :\

  36. Hans Dermot Doran

    Does anyone have a compiled version with this fix available for download? Would it not be possible to make a source code branch for VM users?

  37. Baris Ustun

    Hi, I am new to ubuntu. I've installed gazebo using 'sudo apt-get install ros-kinetic-desktop-full'. it installed version 7.0. Now I want to install 7.4.0 debian. as you suggested.
    Can you show me a way ? because when I try to install by "sudo apt-get install gazebo7" it says nothing new to install.

  38. Jordan Liviero

    Worked for us @nkoenig.

    Prior to fix: sim-94-depth.png

    Post-fix: sim-94-depth-with-gz7-4.png

    Note the floating objects behind the dumpster, which are visible prior but not visible post. Also, the textures on those floating objects are now rendered, when they were not previously. Good work!

  39. Gonzalo Bulnes Guilpain

    Hi everyone,

    TL;DR: I can confirm that installing Gazebo 7.4.0 solves the issue.

    Details:

    I was running Gazebo 7.0.0 and ROS Kinetic in an Ubuntu 16.04 virtual machine (VirtualBox 5.0.28, on a OS X 10.11.3 host). And Gazebo was crashing when I tried to echo any camera-related topic:

    # Terminal 1
    roslaunch turtlebot_gazebo turtlebot_world.launch # requires the ros-kinetic-turtlebot-gazebo Ubuntu package
    
    # Terminal 2
    rostopic echo /cmd_vel_mux/input/teleop # outputs the motion commands as expected
    ---
    linear: 
      x: 0.5
      y: 0.0
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: 0.0
    ---
    linear: 
      x: 0.0
      y: 0.0
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: 0.0
    
    rostopic echo /clock   # outputs the simulated clock ticks as expected
    ---
    clock: 
      secs: 1009
      nsecs: 200000000
    ---
    clock: 
      secs: 1009
      nsecs: 210000000
    ---
    clock: 
      secs: 1009
      nsecs: 220000000
    
    rostopic list | grep depth/
    /camera/depth/camera_info
    /camera/depth/image_raw
    /camera/depth/points
    
    # But trying to echo any camera-related topic outputs:
    rostopic echo /camera/rgb/camera_info 
    WARNING: no messages received and simulated time is active.
    Is /clock being published?
    
    # and also crashes Gazebo in Terminal 1 with the following error message:
    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.
    Aborted (core dumped)
    [gazebo-2] process has died [pid 21993, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /opt/ros/kinetic/share/turtlebot_gazebo/worlds/playground.world __name:=gazebo __log:=/home/gonzalo/.ros/log/ab0fead6-9d94-11e6-9ddc-0800273ffca9/gazebo-2.log].
    log file: /home/gonzalo/.ros/log/ab0fead6-9d94-11e6-9ddc-0800273ffca9/gazebo-2*.log
    

    I arrived here following from the same issue as @SRV_kgp (see comment above) and I can confirm that installing Gazebo 7.4.0 (using Ubuntu packages, no manual compilation needed) solves the issue.

    Many thanks to everyone involved!

  40. Arnold Asllani
    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.
    Aborted (core dumped)
    [gazebo-1] process has died [pid 16706, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/arnold/catkin_ws/src/a1_456_referee/worlds/willow_garage_with_map_publ.world __name:=gazebo __log:=/home/arnold/.ros/log/955631ac-ac33-11e6-8ef5-4c0f6e2b5b73/gazebo-1.log].
    log file: /home/arnold/.ros/log/955631ac-ac33-11e6-8ef5-4c0f6e2b5b73/gazebo-1*.log
    

    I am having this bug. I am using Ubuntu 16.04 on a dual boot not in virtual machine. How can I solve this without running. I am using Gazebo with ROS Kinetic and recompiling would be tough solution.

  41. Freek Hoekstra

    @asllani94 how did you install Gazebo 7.4.0 using Debian packages? My apt-get says Gazebo 7.0.0 is the most recent version

  42. Log in to comment