0
$\begingroup$

Gazebo Answers logo

I want to get a ground plane with a dimension of 11.03x5.66m. For this I have a texture image with the size of 1103x566px (same size but 1px = 1cm)

I followed the instructions posted in here: http://answers.gazebosim.org/question/4761/how-to-build-a-world-with-real-image-as-ground/

So I have the following files:

./materials/scripts/floor_walls_1.material
./materials/textures/floor.png
./model.config
./model.sdf

model.sdf

<?xml version="1.0"?>
<sdf version="1.4">
<model name="floor_walls_1">
  <static>true</static>
    <link name="link">
      <collision name="collision">
        <geometry>
          <plane>
            <normal>0 0 1</normal>
            <size>11.03 5.66</size>
          </plane>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>100</mu>
              <mu2>50</mu2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <cast_shadows>false</cast_shadows>
        <geometry>
          <plane>
            <normal>0 0 1</normal>
            <size>11.03 5.66</size>
          </plane>
        </geometry>
        <material>
          <script>
            <uri>model://floor_walls_1/materials/scripts/floor_walls_1.material</uri>
            <name>FloorWalls1/Image</name>
          </script>
        </material>
      </visual>
    </link>
  </model>
</sdf>

model.config

<model>
  <name>Floor Walls 1</name>
  <version>1.0</version>
  <sdf version="1.5">model.sdf</sdf>

  <description>
    A simple ground plane with texture.
  </description>
</model>

floor_walls_1.material

material FloorWalls1/Image
{
  technique
  {
    pass
    {
      ambient 1 1 1 1.000000
      diffuse 1 1 1 1.000000
      specular 0.03 0.03 0.03 1.000000 
      emissive 0.900000 0.900000 0.900000 1.000000

      texture_unit
      {
        texture floor.png
        scale 0.01 0.01
      }
    }
  }
}

floor.png

floor.png

THE PROBLEM:

Unfortunately this only produces a very weird image (yellow with some anti-aliasing black stripes).

How can I fix the ground plane so that it shows the image at full size?


Originally posted by SailAvid on Gazebo Answers with karma: 3 on 2015-02-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

It showed up for me after these changes:

model.sdf

      <script>
        <uri>model://floor_walls_1/materials/scripts</uri>
        <uri>model://floor_walls_1/materials/textures</uri>
        <name>FloorWalls1/Image</name>
      </script>

floor_walls_1.material

  texture_unit
  {
    texture floor.png
  }

You might also want to adjust the colors in the material to get the circles to show, for me just leaving that information out did the trick.

If your floor comes up blinking grey when you insert it, it's because it's z-fighting with the default ground_plane, just delete the ground plane and that should be fine.


Originally posted by chapulina with karma: 7504 on 2015-02-02

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.