Coder Social home page Coder Social logo

gazebo_terrain's Introduction

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

gazebo_terrain's People

Contributors

matthewverbryke avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.