Source

gazebo / doc / tutorial_terrain.html

/**

\page tutorial_terrain Terrain Tutorial

This tutorial will describe how to create and use terrains via heightmaps. The contents of the page include:

- \ref tutorial_terrain_image
- \ref tutorial_terrain_xml

\section tutorial_terrain_overview 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.

\section tutorial_terrain_image 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 <tt>/usr/local/share/gazebo/Media/matierals/textures</tt>.

Below is an example image:

\image html terrain.png Example Heightmap Image.

\section tutorial_terrain_xml Worldfile Syntax

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

\verbatim
<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>
\endverbatim

- image : The heightmap image
- worldTexture : General texture to apply to the terrain
- detailTexture : Texture applied to the terrain when the camera is close
- size : Size to make the terrain

Currently a terrain cannot be placed at custom coordinates.
*/