Ask Your Question
0

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

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

Pi Robot gravatar image

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

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

3 Answers

Sort by ยป oldest newest most voted
0

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

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 imagePi Robot ( 2011-08-09 04:07:42 -0500 )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 imageLiMuBei ( 2011-08-09 19:27:34 -0500 )edit
1

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

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 imagePi Robot ( 2011-08-08 01:50:46 -0500 )edit
0

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

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_J gravatar imageCyril_J ( 2018-04-26 09:29:06 -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

Stats

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

Seen: 6,371 times

Last updated: May 01 '14