0
$\begingroup$

Rosanswers logo

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


Originally posted by Hozefa Indorewala on ROS Answers with karma: 28 on 2012-02-15

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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:

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

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

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

Originally posted by Stefan Kohlbrecher with karma: 24361 on 2012-02-15

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Hozefa Indorewala on 2012-02-16:
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 http://i.imgur.com/BnIxN.png
  2. Back http://i.imgur.com/oZvTG.png

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

Comment by Stefan Kohlbrecher on 2012-02-16:
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?

Comment by Hozefa Indorewala on 2012-02-16:
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.

Comment by Stefan Kohlbrecher on 2012-02-16:
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).

Comment by Hozefa Indorewala on 2012-02-16:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.