You should get a heightmap in Gazebo similar to the image below: Try doing the same with the DEM file for Mount St. $ GAZEBO_RESOURCE_PATH="$GAZEBO_RESOURCE_PATH:/tmp" gazebo /tmp/volcano.world # Be sure of sourcing gazebo setup.sh in your own installation path In our case, the file is in the /tmp directory. Launch Gazebo with the world containing your DEM file and you should see the volcano. The minimum elevation for this particular DEM file is 685 meters, so in the element, we translate the entire DEM in negative z direction so that it sits at z=0 in the world. In our example, the DEM will be scaled to a square of 150 x 150 meters and a height of 50 meters. If you want to maintain the correct aspect ratio, be sure to properly calculate its size in all three dimensions. In case you prefer to scale the DEM, the element tells Gazebo the size in meters that the terrain will have in the simulation.
#Civil3d digital terrain model code#
The element in the code above tells Gazebo whether to load the DEM with the original dimensions (when is not present) or to scale it (when is present). įile://media/materials/textures/dirt_diffusespecular.pngįile://media/materials/textures/flat_normal.pngįile://media/materials/textures/grass_diffusespecular.pngįile://media/materials/textures/fungus_diffusespecular.png Save the file anywhere you want, for example, in /tmp. Create the file volcano.world and copy the next content. Gazebo automatically detects if the file is a plain image or a DEM file. $ gdalwarp -ts 129 129 /tmp/m /tmp/media/dem/mtsthelens_129.demĪ DEM file in Gazebo is loaded in the same way that you load a heightmap image. The next command will scale the terrain to 129x129 and will copy into the Gazebo media/dem/ directory. Usually, DEM files have big resolutions and Gazebo cannot handle it, so it's a good idea to adjust the resolution of your DEM. Unzip ~/Downloads/mtsthelens_before.zip -d /tmp Unzip the file and rename it m as follows: cd ~/Downloads There are several organizations that provide elevation data.
#Civil3d digital terrain model install#
$ sudo apt-get install gdal-bin libgdal-dev python-gdalĭEM file and the definition into SDF format In order to work with DEM files you should install GDAL libraries. Rescue or agriculture applications might be interested in testing their robot behaviors using a simulated terrain that matches the real world. The main motivation to support DEMs in Gazebo is to be able to simulate a realistic terrain. Currently, Gazebo only supports raster data in the supported formats available in GDAL. In fact, the DEMs can be represented as a grid of elevations (raster) or as a vector-based triangular irregular network (TIN). The term DEM is just a generic denomination, not a specific format. Wikipedia is a good resource for getting more details about DEMs. The terrain elevations for ground positions are sampled at regularly-spaced horizontal intervals. DEMs are frequently created by using a combination of sensors, such as LIDAR, radar, or cameras. A Digital Elevation Model (DEM) is a 3D representation of a terrain's surface that does not include any objects like buildings or vegetation.