osrf / gazebo_osm

OpenStreetMap support for Gazebo
29 stars 37 forks source link

<road> has no element <texture> #8

Open l0g1x opened 9 years ago

l0g1x commented 9 years ago

Just simply using the gz_osm.py with default value, the SDF is produced with road elements, which have a non-existent sub element , like so:

<road name="footway_87383624">
      <texture>footway</texture>
      <width>0.3</width>
      <point>80.8064537091 -127.894211004 0.0</point>
      <point>65.8062953159 -130.038706459 0.0</point>
</road>

I believe it should be instead of as defined here: http://sdformat.org/spec?ver=1.5&elem=world#world_road and example here: https://bitbucket.org/osrf/gazebo/src/3e1e86e456efae91240b61a42238e437ab07bdad/worlds/road_textures.world?at=default

When loading it into gazebo theres a warning from parser.cc stating as well:

Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.
Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.
Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

My question is, how are the road texture images still showing?

l0g1x commented 9 years ago

found the answer to my own question at the bottom here: https://bitbucket.org/osrf/gazebo/src/3e1e86e456efae91240b61a42238e437ab07bdad/gazebo/rendering/Road2d.cc?at=default#cl-384

first checking if element has a material, otherwise set it to Gazebo/Road