Gazebo Tutorial by Rasko Pjesivac What is Gazebo Gazebo is a simulator for a small group of robots in 3D environment Similarly to Stage a 2D environment simulator Gazebo can simulate a population of robots objects and sensors There are a few differences between the two simulators Gazebo is designed for a small number of robots while Stage can handle hundreds of robots In addition Gazebo has a higher precision then Stage Since both Gazebo and Stage are Playercompatible client programs written using one simulator can usually be run on the other one with some or no modifications Installing Gazebo You do not need to worry about installing Gazebo since it is already installed on UTK CS Linux machines However if you decide to do it yourself this tutorial describes the process that you have to follow this process can be tricky First you should go to official Player Stage Gazebo website http playerstage sourceforge net gazebo gazebo html Then go to the download section to get the latest version of Gazebo along with the updated documentation Read the documentation Steps to install Gazebo 1 Installing the requirements of Gazebo GUI component of Gazebo requires two third party packages SWIG and wxPython Python bindings for wxWidgets Beside these two packages minimal Gazebo installation also requires ODE OpenDynamicEngine In addition some terrain models and roads require OPCODE collision detection library which is now part of the ODE distribution Therefore when installing ODE package make sure that you are installing it with OPCODE collision detection library enabled To support terrain builder utility of Gazebo GDAL library Geospatial Data Abstraction Library has to be installed as well Links to these packages and installation instructions are provided on Gazebo s website Once all these packages are installed you can start configuring and installing Gazebo 2 Installing Gazebo First you need to get the source code from the official website if you still have not done it After this you will need to set up some necessary compiler paths for your shell The paths for UTK CS machines are listed bellow export PATH PATH usr local lib export PLAYERPATH usr local lib export LD LIBRARY PATH usr local lib usr local pkgs Python 2 4 1 lib In addition to these paths you might need to set up the following flags these are UTKCS specific export CFLAGS I pkgs player stage 2 0 3 include I usr local include export CPPFLAGS I pkgs player stage 2 0 3 include I usr local include export LDFLAGS L pkgs player stage 2 0 3 lib L usr local lib Wl rpath pkgs player stage 2 0 3 lib Wl rpath usr local lib export PYTHONPATH pkgs player stage 2 0 3 lib python2 4 sitepackages pkgs player stage 2 0 3 lib python2 4 site packages wx 2 7 2 gtk2ansi You are now ready to run configure and make scripts to install Gazebo With configure script which you have downloaded with the source code you can specify the path where you want to install Gazebo This can be done by typing linux configure prefix home username wherever After this the configure script will have adapted the Makefile to use the proper libraries compiler options and installation directory If you have enabled some optional features of Gazebo configure script would include them into the Makefile as well Now you just need to run linux make linux make install make will try to compile all the parts of Gazebo Depending on the speed of your machine this process can take a while make install will put all the binaries into the directory specified earlier If everything has been properly set up and make and make install have been completed without errors the installation process is finished Terrain Builder Utility of Gazebo Gzbuilder Gzbuilder is a terrain builder part of Gazebo Gzbuilder can build different terrains depending on kind of data provided as its input It can create a 3D terrain of a floor plan or an outdoor map if a Digital Elevation Model DEM is passed as its input Output is gzb file that is usable by Gazebo Basic syntax for Gzbuilder is the following linux gzbuilder options i inputfile o outputfile where the options are i filename Input terrain file o filename Output Gazebo terrain file e double Acceptable error bound on terrain approximation meters Set this to zero for no approximation h double Horizontal scaling factor m v double Vertical scaling factor m n Normalize Z values before scaling x double X offset m y double Y offset m z double Z offset m u int UTM zone Default is 11 s double X size of texture meters t double Y size of texture meters Here is an example command that creates a 3D map based on the image file hospital section png linux gzbuilder i hospital section png o hospital gzb n v 2 4 h 0 1 e 0 1 where the options are n normalizes the input image in the range 0 for black pixels and 1 for white pixels v 2 4 scales heights so the white pixels correspond to an elevation of 2 4 meters h 0 1 scales the image so the distance between each pixel on the map correspond to distance of 0 1 meter e 0 1 allows Gzbuilder to create a terrain with maximum elevation error of 0 1 meter NOTE1 Gzbuilder can take any file in format supported by GDAL library as an input For the full list of supported formats visit www gdal org formats list html NOTE2 The version of hospital section png given earlier in the class had black pixels representing the walls and white pixels representing the free area However Gzbuilder needs this to be reversed The reversed version of hospital section png can be found in research playerstage examples directory How to use Gazebo Creating a world file As mentioned above Gazebo is a multi robot simulator for both indoor and outdoor environments Gazebo takes a world file as an input This is an XML file containing the description of the world The following header block is required at the beginning of each world file xml version 1 0 gz world xmlns gz http playerstage sourceforge net gazebo xmlschema gz xmlns model http playerstage sourceforge net gazebo xmlschema model xmlns sensor http playerstage sourceforge net gazebo xmlschema sensor xmlns window http playerstage sourceforge net gazebo xmlschema window xmlns param http playerstage sourceforge net gazebo xmlschema params xmlns ui http playerstage sourceforge net gazebo xmlschema params definition of the world is entered here gz world The following code is an example of the definition of the world This world contains one Pioneer2DX robot equipped with a laser sensor model Pioneer2DX id robot1 id xyz 0 0
View Full Document
Unlocking...