0
$\begingroup$

Rosanswers logo

Hello,

I have both STL and Collada (.dae) versions of several meshes (Dynamixel servos and brackets) and I can view both in RViz when used in the URDF file for my robot. However, the material colors I specify for the meshes appear only when using the STL versions of the meshes. When using the Collada (.dae) versions, all meshes appear white regardless of the material or color tags I use in the URDF file. Does one have to specify the material or color differently when using Collada meshes?

P.S. You may ask why I don't just use the STL files and it is because on one of my machines there is a graphics driver bug that prevents the STL meshes from appearing in RViz but the Collada versions appear fine, although without the colors.

UPDATE:

I have figured out a work-around in the meantime: First I imported the TurtleBot's kinect.dae file into Blender, then I imported the AX-12 STL file, and finally, I copyied the material from the Kinect object to the AX-12 object. Then I deleted the Kinect object and exported the AX-12 as a Collada file. At least now I have black servos in RViz!


Originally posted by Pi Robot on ROS Answers with karma: 4046 on 2011-08-07

Post score: 1

$\endgroup$

4 Answers 4

0
$\begingroup$

Rosanswers logo

Pale white meshes usually have something to do with the ambient color. At least that is what's usually causing that look in the Ogre engine (which RViz is using). I haven't used dae with RViz, but maybe you can dig into that direction and see if the Collada file contains anything like ambient color or if there's an environment set.


Originally posted by LiMuBei with karma: 261 on 2011-08-09

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by LiMuBei on 2011-08-09:
If that worked, then it must be a material setting that is causing this. Compare the material settings in Blender or the resulting export and you should find something :)

Comment by Pi Robot on 2011-08-09:
Thanks for the suggestion--I'll give that a try if I can figure out how. In the meantime, I cheated by importing the TurtleBot's kinect.dae file into Blender, then importing the AX-12 STL file, and finally, copying the material from the Kinect object to the AX-12 object. Then I deleted the Kinect object and exported the AX-12 as a Collada file. At least now I have black servos in RViz!

$\endgroup$
0
$\begingroup$

Rosanswers logo

Collada files have color built in to the mesh definition while STL files do not. I think the default for RVIZ is to simply use what is specified in the file.

Collada is a pretty reasonable XML format. Since you probably one have one color, there will probably just be one tag to change in order to set the color.


Originally posted by adasta with karma: 508 on 2011-08-07

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Pi Robot on 2011-08-08:
Thanks adasta. To test your idea, I brought the original STL file for a Dynamixel AX-12 into Blender, gave it a material color of nearly black for both the diffuse and specular settings as well as a translucency of 0. This makes it look like a very black solid AX-12 in Blender. I then exported the object in Collada format and pointed to that file in my URDF model. Unfortunately, the AX-12's in RViz still look very light grey--almost ghostly. I've tried a number of other color settings and also tried adding textures in Blender but I never get anything other than shades of pale grey in RViz.

$\endgroup$
0
$\begingroup$

Rosanswers logo

For those who still have that problem (as I did after exporting my blender file to Collada), the trick is to make sure that ambient in the material in the collada file is set properly. It should look like this:

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

Originally posted by Andrzej Pronobis with karma: 43 on 2014-05-01

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Cyril Jourdan on 2018-04-26:
It's not working for me in ROS Kinetic. Anyone got it working ?

Comment by ParitoshKelkar on 2019-10-03:
By changing the values in

   <emission>
        <color sid="emission" x y z 1</color>
</emission> 

I could turn a black dae to white .. (from 0 0 0 to 1 1 1).

Comment by Combinacijus on 2023-01-04:
Inside which tag <ambient> should be put?

$\endgroup$
0
$\begingroup$

Rosanswers logo

If the mesh_use_embedded_materials flag is set to true and the mesh is of a type which supports embedded materials (such as COLLADA), the material defined in that file will be used instead of the color defined in the marker.

http://wiki.ros.org/rviz/DisplayTypes/Marker#Mesh_Resource_.28MESH_RESOURCE.3D10.29_.5B1.1.2B-.5D


Originally posted by lucasw with karma: 8729 on 2019-10-24

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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