ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Mesh rendering in RViz

asked 2012-02-15 21:58:05 -0500

Hozefa Indorewala gravatar image

Hello all,

I am having troubles with the rendering of my meshes in RViz. The models are created in Maya and then exported to OBJ format. They are then imported in Blender and re-exported to DAE format as a final step before visualizing them in RViz. The two step export process is done because the DAE files exported directly from Maya (using the PolyTrans plugin) cause an error in RViz. Here's a screenshot of the model in RViz.

Since my knowledge of 3D modelling is limited, I would appreciate your help regarding the issue. I can also provide the mesh files if required.

Thank you in advance.

Cheers, Hozefa

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-15 22:12:24 -0500

updated 2012-02-15 22:32:22 -0500

That actually doesn't look too bad, my starting experience with Blender based COLLADA was much worse, as you can read about here. Quoting the answer by @stefan-osswald there:

"There is a bug in RViz that replaces the ambient color of Collada materials by light gray if at least one component of the specified ambient color is 0.0 (see Ticket #5237). According to the changelog, this bug is fixed in robot_model 1.6.4, which seems to be not in the electric .deb repository yet."

What you for instance can try is manually editing your .dae files and setting non-zero ambient components for the used materials.

/edit: Update to be more specific: Entries like this:

      <color sid="ambient">0.4 0.4 0 1</color>

have to be changed so all components are non-zero, for example:

      <color sid="ambient">0.4 0.4 0.1 1</color>
edit flag offensive delete link more


Thanks for the help Stefan. I tried out your suggestion and the mesh now looks better but it has too many "dark spots". Some screenshots: 1. Front 2. Back

I included the 'library_lights' in the DAE files but that didn't help.

Hozefa Indorewala gravatar image Hozefa Indorewala  ( 2012-02-16 02:50:33 -0500 )edit

Some dark spots on the parts of the robot facing away from the light are expected, as rviz apparently only has a single light source (at least that's what I gather, details like that are not well documented). Also, can you open your .dae files in meshlab and check the normals are all good?

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2012-02-16 03:21:35 -0500 )edit

I checked the face normals in both maya and meshlab and they seem fine. I hope more light sources are added in the future. Nonetheless, thank you again for your help.

Hozefa Indorewala gravatar image Hozefa Indorewala  ( 2012-02-16 03:36:02 -0500 )edit

Ok, so what might also improve the looks is setting the shading to "flat" instead of "smooth" for some faces (you can do that on a per face basis in Blender). Smooth shading can lead to dark spots at sharp corners (Not sure if those are the dark spots you're referring to).

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2012-02-16 03:42:12 -0500 )edit

I tried flat shading my models in Maya itself and then performed the obj-import dae-export in Blender (I use Maya for working with the models and Blender just for importing-exporting), but that didn't help either. I think it looks fine for now.

Hozefa Indorewala gravatar image Hozefa Indorewala  ( 2012-02-16 04:11:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-02-15 21:58:05 -0500

Seen: 3,823 times

Last updated: Feb 15 '12