Home | Tutorials | Wiki | Issues
Ask Your Question
0

Loading in CAD model with colors

asked 2016-08-02 05:57:46 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have been trying to get a CAD *.step file converted to collada *.dae and to get shown in Gazebo with correct colors. I all cases it seems that I only get the grey uncolored version, when Gazebo loads the dae file. I am current using ROS indigo with the standard Gazebo distribution that is part of this release.

In MeshLab I am able to see the colors correctly in the exported *.dae models: image description

I have also been attempting to convert using FreeCad, Rhinoceros, Blender, Solidworks. But I still ended up unable to display the colors from the step file.

The way I include into gazebo the *.dae is the following:

<?xml version='1.0'?>
<sdf version='1.4'>
  <model name="robot_v3_solid">
    <static>true</static>
    <link name="body">
      <pose>0 0 0 0 0 0</pose>
      <collision name="collision">
        <geometry>
          <mesh>
            <uri>model://robotti_v3_solid/model/meshes/robot_body.dae</uri>
          </mesh>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh>
            <uri>model://robotti_v3_solid/model/meshes/robot_body.dae</uri>
          </mesh>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>

Is there some method or program I can use, to convert my *step files into *.dae, to ensure gazebo is able to read the colors and display them correctly ? I have been looking trough the guides but have not bee able to find an answer to this problem. Re-coloring all components individually via sdf files, with just to much trouble, so I am looking for a better option.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2016-08-03 10:51:42 -0600

mpc gravatar image

I found a solution to my problem. basicly I converted my *.step files into *.obj files using solidworks or CAD exchanger. I am not sure if any other program is able to do this first step. Then I loaded the obj file into blender 2.7 and made the correction in terms of scale and export to *.dae. The result can be seen below: image description.

So the trick to get from *.step to *.dae with colors was the obj trick:

xx.step -> (xx.obj, xx.mtl) -> xx.dae.

edit flag offensive delete link more
0

answered 2016-08-03 10:39:33 -0600

nkoenig gravatar image

Your DAE files use a COLOR input to the triangles. Gazebo currently does not support this Collada feature. We do support texture mapping though.

edit flag offensive delete link more

Comments

Yes I get that now :-( I just found a solution 4 minutes ago. Will post a guide in a moment or two.

mpc gravatar imagempc ( 2016-08-03 10:43:03 -0600 )edit
0

answered 2016-08-02 11:56:32 -0600

This looks like a bug. You're probably using Gazebo 2, which is no longer supported and won't receive bug fixes. I would try upgrading your Gazebo version and seeing if the issue persists.

if it persists, I would ticket an issue. It would also help if you included the file which is having problems.

edit flag offensive delete link more

Comments

I upgraded to ROS jade and the std Gazebo 5 in ubuntu 14.04, but the result seems to be the same. Basically I think I am doing something wrong when I do the conversion into dae, but I have been unable to find a good guide that explain the color part.

mpc gravatar imagempc ( 2016-08-02 15:47:32 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-08-02 05:57:46 -0600

Seen: 634 times

Last updated: Aug 03 '16