cyberbotics / urdf2webots

Utility to convert URDF files to Webots PROTO nodes
Apache License 2.0
127 stars 43 forks source link

Colors not being applied when pre-defined in URDF #210

Open IDavGal opened 12 months ago

IDavGal commented 12 months ago

I'm having issues applying colors to a URDF-generated robot. The links use a material by name, previously defined in the URDF, but they don't appear in the simulation. Defining the color in the first link that uses it, and then referencing it consecutively works, but my issue is regarding these lines of the importer.py, in which the <material> tag is parsed and the color definition is stored.

My urdf looks like:

  <material name="blue">
    <color rgba="0 0 1 1"/>
  </material>

  <link name"mylink" >
    <visual>
      <geometry>
        ...
      </geometry>
      <material name="blue" />
    </visual>
  </link>