Home | Tutorials | Wiki | Issues
Ask Your Question
0

texture doesn't load properly

asked 2017-10-04 21:37:29 -0500

yjy765 gravatar image

updated 2017-10-04 21:38:53 -0500

I downloaded rotors_simulator and execute yosemite.world in gazebo

Following is the screenshot for it

image description

(I removed the grass plane model so it contains only yosemite.sdf in the world file)

And the following is yosemite model sdf code

<?xml version="1.0" ?>
<sdf version="1.4">
  <model name="yosemite">
    <static>true</static>
    <link name="link">
      <collision name="collision">
        <geometry>
          <heightmap>
            <uri>model://yosemite/materials/textures/yosemite.png</uri>
            <size>1000 1000 125</size>
           <pos>0 0 -15</pos>
          </heightmap>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0.2</mu>
              <mu2>0.2</mu2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <geometry>
          <heightmap>
            <texture>
              <diffuse>file://media/materials/textures/dirt_diffusespecular.png</diffuse>
              <normal>file://media/materials/textures/flat_normal.png</normal>
              <size>50</size>
            </texture>
            <texture>
              <diffuse>file://media/materials/textures/terrain_detail.jpg</diffuse>
              <normal>file://media/materials/textures/flat_normal.png</normal>
              <size>75</size>
            </texture>
            <texture>
              <diffuse>file://yosemite/materials/textures/texture_forest.png</diffuse>
              <normal>file://media/materials/textures/flat_normal.png</normal>
              <size>100</size>
            </texture>
            <texture>
              <diffuse>file://yosemite/materials/textures/texture_mountains.png</diffuse>
              <normal>file://media/materials/textures/flat_normal.png</normal>
              <size>50</size>
            </texture>
            <blend>
              <min_height>35</min_height>
              <fade_dist>10</fade_dist>
            </blend>
            <blend>
              <min_height>60</min_height>
              <fade_dist>10</fade_dist>
            </blend>
            <blend>
              <min_height>90</min_height>
              <fade_dist>10</fade_dist>
            </blend>
            <uri>model://yosemite/materials/textures/yosemite.png</uri>
            <size>1000 1000 125</size>
            <pos>100 0 -30</pos>
          </heightmap>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>

And the texture file can be found at https://github.com/ethz-asl/rotors_si... (I can't upload it due to the maximum size limit, sorry)

So I think the former two texture file is loaded well, which are given in gazebo. On the other hand, the latter two texture file is not loaded properly, which are given by user.

How can I address this issue?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-10-05 06:49:49 -0500

wentz gravatar image

May be a problem with the path's that gazebo is using. For example when you use model:// to include a file

<uri>model://yosemite/materials/textures/yosemite.png</uri>

it will look in $GAZEBO_MODEL_PATH/yosemite/materials/textures/yosemite.png to load the image. Everything you include with file://

<diffuse>file://media/materials/textures/dirt_diffusespecular.png</diffuse>

gazebo will search in $GAZEBO_RESOURCE_PATH/media/materials/textures/dirt_diffusespecular.png

Did you made sure that these path's and directories are set correct and that the png files are in the right locations? You can check the path's with

echo $GAZEBO_MODEL_PATH
echo $GAZEBO_RESOURCE_PATH
edit flag offensive delete link more

Comments

Thanks!! @wentz you're right I set $GAZEBO_MODEL_PATH but I didn't know about GAZEBO_RESOURCE_PATH

yjy765 gravatar imageyjy765 ( 2017-10-05 23:37:40 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-10-04 21:37:29 -0500

Seen: 18 times

Last updated: Oct 05