ROS indigo rviz OGRE mesh wrong lighting

asked 2014-11-20 01:51:18 -0500

Torsten gravatar image

updated 2014-11-20 08:47:35 -0500

Hi All,

i got another issue with the ROS rviz plugin while moving from hydro to indigo version. I wrote a rviz-plugin which loads and display a ogre mesh (a vehicle to be more exact). In ROS hydro everything is the more or the less fine, the mesh is drawn as it should and also the lighting is correct.

If i change nothing in the plugin and only change the ROS version to indigo, some really strange things happen:

  1. The lighting of the mesh seams to be broken, nearly all surfaces are drawn black.
  2. The mesh seams to be drawn twice. I tried to add a GLSL shader program which adds a simple phong-shading to some surfaces / materials. Despite of that the model and view matrix will not get passed correctly to the shader (i used the auto params) i got some heavy z-fighting on surfaces which definitely are not modeled double sided.

What i already tried / did:

  1. Double checked normals, they are ok.
  2. Viewed the model with the Ogre Max Viewer, which also uses OGRE Version 1.8.1 (same as the ROS indigo) - Lighting is correct!
  3. Wrote a simple test program which not uses ROS. - Lighting is correct!
  4. Updated mesh with the Update Utility of OGRE.
  5. Tested another mesh - Same issue!
  6. Programmatically changed Face Culling, Light, various material values of the mesh, use own GLSL shader (see above) Nothing changed. ( Set ambient light in scene-manager, add additional light to scene ... )
  7. Exported a simple cube from Blender (start scene cube) 2.69.0 with blender2ogre-0.6.0 and tested this mesh in both ROS versions. Same here, Cube is black in ROS indigo and white (correct lighting) in ROS hydro. Both with identical rviz plugin.
  8. Cloned newest rviz version (indigo-devel-branch) to ROS-hydro version so rviz 1.11.3 will run under ROS-hydro, everything works well! I also tested the old rviz version 1.10.18 (hydro-devel-branch) under ROS-indigo, lighting still broken. So it seems that the new Ogre-Version 1.8.1 is the cause of this problem, or maybe a not correctly adapted rviz.

What seems to work:

  1. Emissive materials seems to work in ROS indigo. The cube will be red if emissive set to 1 0 0 1 in ogre-material file.

Did someone of you encounter the same problems drawing OGRE Meshes in ROS-indigo-rviz?

Mesh in ROS Hydro:

image description

Mesh in ROS Indigo:

image description

edit retag flag offensive close merge delete

Comments

Fixed your image links: links to html pages won't work.

gvdhoorn gravatar image gvdhoorn  ( 2014-11-20 03:12:32 -0500 )edit

Thank you for fixing my post again!

Torsten gravatar image Torsten  ( 2014-11-20 03:17:38 -0500 )edit

@Torsten: have you considered reporting this to the RViz bugtracker? It seems like you have already narrowed things down pretty well.

gvdhoorn gravatar image gvdhoorn  ( 2014-11-20 09:01:41 -0500 )edit

@gvdhoorn: i added a new issue to the RViz bugtracker and added a link to this post, hopefully this ok!

https://github.com/ros-visualization/...

Torsten gravatar image Torsten  ( 2014-11-21 01:03:36 -0500 )edit

Yes, that is ok. You could perhaps summarise the contents of your question here in the issue on github, so the issue stands on its own.

gvdhoorn gravatar image gvdhoorn  ( 2014-11-21 05:00:54 -0500 )edit

Done. Don't take me wrong but this process seams to be very time consuming. Thank you for your help.

Torsten gravatar image Torsten  ( 2014-11-21 06:01:03 -0500 )edit

Which process? The ROS Answers forum is moderated and frequented by volunteers (in addition to OSRF employees), it is not a dedicated support forum :).

And for reporting bugs -- as you essentially did -- it is always a good idea to directly go to the github repository of the relevant package.

gvdhoorn gravatar image gvdhoorn  ( 2014-11-21 09:00:24 -0500 )edit