ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Can material colors be applied to Collada (.dae) meshes?

asked 2011-08-07 14:58:33 -0600

Pi Robot gravatar image

updated 2011-08-09 04:09:19 -0600

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!

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2011-08-09 00:44:41 -0600

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.

edit flag offensive delete link more

Comments

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!
Pi Robot gravatar image Pi Robot  ( 2011-08-09 04:07:42 -0600 )edit
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 :)
LiMuBei gravatar image LiMuBei  ( 2011-08-09 19:27:34 -0600 )edit
2

answered 2011-08-07 15:52:27 -0600

adasta gravatar image

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.

edit flag offensive delete link more

Comments

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.
Pi Robot gravatar image Pi Robot  ( 2011-08-08 01:50:46 -0600 )edit
1

answered 2014-05-01 16:24:03 -0600

Andrzej Pronobis gravatar image

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>
edit flag offensive delete link more

Comments

It's not working for me in ROS Kinetic. Anyone got it working ?

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-04-26 09:29:06 -0600 )edit

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).

ParitoshKelkar gravatar image ParitoshKelkar  ( 2019-10-03 11:30:17 -0600 )edit

Inside which tag <ambient> should be put?

Combinacijus gravatar image Combinacijus  ( 2023-01-04 09:28:53 -0600 )edit
1

answered 2019-10-24 13:14:23 -0600

lucasw gravatar image

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...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-08-07 14:58:33 -0600

Seen: 10,778 times

Last updated: Oct 24 '19