Gazebo

Terrain Tutorial

This tutorial will describe how to create and use terrains via heightmaps.

The contents of the page include:

Overview

Gazebo makes use of heightmaps for terrains. Heightmaps are extruded vertically from a 2D image. Therefore no overhangs or tunnels can be formed.

IMPORTANT: ODE version 0.8 or less in incompatible with terrains, due to problems with Ray and Heightmap collision detection. If the highest numbered version of ODE is 0.8, then install from their SVN sources.

Heightmap Image

A heightmap is based on a greyscale image. The image must be square with a width and length of (2^n) + 1. For example an image of size 513x513 is valid, while 512x512 is not.

The image you wish to use must be place in Gazebo's Media directory. If you installed Gazebo globally, this would be /usr/local/share/gazebo/Media/matierals/textures.

Below is an example image:

terrain.png

Example Heightmap Image.

Worldfile Syntax

A terrain can be used in Gazebo by specifying a heightmap image, texture images, and a size.

<model:physical name="terrain_model">
  <body:heightmap name ="terrain_body">
    <geom:heightmap name="terrain_geom">
      <image>terrain.png</image>
      <worldTexture>terrain_texture.jpg</worldTexture>
      <detailTexture>terrain_detail.jpg</detailTexture>
      <size>1000 1000 10.0</size>
    </geom:heightmap>
  </body:heightmap>
</model:physical>

Currently a terrain cannot be placed at custom coordinates.


Last updated Aug 04 2007