Skip to content

l-schilling/gazebo_terrain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gazebo Terrain Model Generator

Summary

This repository contains a simple python-based program that can generate a Gazebo terrain model from a greyscale PNG image input. The program creates the necessary files for the model based on user input, while also resizing and reformating the given heightmap image to ensure compatability with Gazebo. (Based on this tutorial)

Requirements

The program requires the following to function:

Tested on Ubuntu 16.04 LTS with Gazebo 7.9

Instructions

Installation

Clone the repsitory into your home/$USER/catkin_ws/src/ directory

Terrain Generation

Place your heightmap image into your Pictures directory before running the program so that it can be found. This image should be a greyscale PNG.

In order for this program to work:

  1. The PNG should be a greyscale image without any alpha channels (ideally an unsigned 8-bit image, but the code should be able to convert other bit-size images to the proper format).
  2. The height and width (in pixels) of the PNG must be equal.

In the gazebo_terrain directory, run the program with:

./terrain_gen.sh

When running the program, it will first ask you for the name of your image; make sure that this is the same as the image in the Pictures directory but without the ".png"! You will then be asked to enter various information needed to fill out the configuration files, such as the menu name for the model, size, and other parameters.

Once the program is finished generating the files, open up Gazebo to test out your model. The name that you selected for the model should appear on the Insert menu bar.

Deleting Models

Also included in this repository is delete_model.sh, a script that can look into the Gazebo model directory and interactively delete the user-selected directory, if it exists. Be careful to not delete default Gazebo models or anything you want to keep when using this!

Run it with:

./delete_models.sh

Notes

  • I have managed to get up to 8km x 8km terrains to spawn without issue on my computer
  • The image output should be an 8-bit greyscale image. Conversion from 16-bit to 8-bit images are confirmed to work, but it should work with larger grayscales (this still needs to be tested).
  • Based on issues others have been having, it appears that you need Gazebo 7.9 or higher for heightmap insertion to work (may work with versions as low as 7.7).

License

This program is licensed under the BSD 3-clause license, as presented in the LICENSE file

Program is Copyright (c) University of Cincinnati

About

Terrain model generator for Gazebo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.2%
  • Shell 30.8%