Skip to content

Conversation

jennuine
Copy link
Contributor

🎉 New feature

Summary

Tutorial on preparing DEMs and using them in Gazebo.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Signed-off-by: Jenn Nguyen <[email protected]>
@github-actions github-actions bot added the 🪵 jetty Gazebo Jetty label Jul 19, 2025
@azeey azeey added this to the Jetty Release milestone Jul 28, 2025
@azeey azeey removed this from the Jetty Release milestone Aug 26, 2025
@jennuine jennuine changed the title [WIP] Digital Elevation Model (DEM) tutorial Digital Elevation Model (DEM) tutorial Oct 21, 2025
@jennuine jennuine requested a review from iche033 October 21, 2025 08:22
@jennuine jennuine changed the base branch from main to gz-sim10 October 21, 2025 08:23
@jennuine jennuine marked this pull request as ready for review October 21, 2025 08:23
@jennuine jennuine requested a review from arjo129 as a code owner October 21, 2025 08:24
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I did a first pass review and added some comments

The Ubuntu github CI also picked up some minor lint issues.


Meshes were the format used for the [Darpa Subterranean Challenge (SubT) simulation](https://github.com/osrf/subt/wiki)
and most were created from point cloud converted data (check out this [tutorial on how to convert point cloud data to a 3D mesh model for Gazebo](http://gazebosim.org/api/sim/10/pointcloud.html)).
These heightmap meshes can be found [here on fuel](https://app.gazebosim.org/OpenRobotics/fuel/collections/SubT%20Tech%20Repo).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These heightmap meshes can be found [here on fuel](https://app.gazebosim.org/OpenRobotics/fuel/collections/SubT%20Tech%20Repo).
These heightmap meshes can be found [here on Fuel](https://app.gazebosim.org/OpenRobotics/fuel/collections/SubT%20Tech%20Repo).

### Meshes

Another format used for realistic topography are meshes, which are 3D polygonal models.
The supported file formats for meshes in Gazebo are DAE, FBX, GLTF, OBJ, and STL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed FBX because it's not very well tested in Gazebo

Suggested change
The supported file formats for meshes in Gazebo are DAE, FBX, GLTF, OBJ, and STL.
The supported file formats for meshes in Gazebo include DAE, GLTF, OBJ, and STL, and more.

### Image heightmaps

Image heightmaps use a 2D grayscale image, where each pixel coresponds to the elevation at that point. Black (or `0`) represents the lowest point and while (or `255`) represents the highest.
This is a simple and efficient way to store elevation data because less memory compared to meshes and DEMs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is a simple and efficient way to store elevation data because less memory compared to meshes and DEMs.
This is a simple and efficient way to store elevation data because it can use less memory compared to meshes and DEMs.

For fields like robotics, accurate topography can be beneficial for develop algorithms and/or models for autonomous navigation, motion planning, task planning, and control because they can provide cost effective, rapid development cycles.
Engineers can develop and test algorithms in these environments before physical deployment.

In this tutorial we'll dive deeper into what makes heightmaps, where to get them, and how to process them to use for simulation in modern Gazebo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this tutorial we'll dive deeper into what makes heightmaps, where to get them, and how to process them to use for simulation in modern Gazebo.
In this tutorial we'll dive deeper into what makes heightmaps, where to get them, and how to process them to use for simulation in Gazebo.


## Gazebo's supported heightmap types

Modern Gazebo supports image heightmaps, meshes, and Digital Elevation Models (DEMs).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Modern Gazebo supports image heightmaps, meshes, and Digital Elevation Models (DEMs).
Gazebo supports creating a terrain from image heightmaps, meshes, and Digital Elevation Models (DEMs).

* If the Processing Toolbox panel isn't open, click the gear icon in the top toolbar

* Search for "Clip raster by extent" and double click to open the dialog
* Input layer: should be the imported geotif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalized for consistency

Suggested change
* Input layer: should be the imported geotif
* Input layer: should be the imported GeoTiff

<visual name="visual">
<geometry>
<heightmap>
<use_terrain_paging>false</use_terrain_paging>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this line as it's no longer used

Suggested change
<use_terrain_paging>false</use_terrain_paging>

</model>
```

Launch Gazebo and it should look something like this:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some instructions?

I think the users will need to be in the half_dome_example for the textures to load

cd tutorials/files/digital_elevation_models/half_dome_example
gz sim -v 4 half_dome.sdf

<visual name="visual">
<geometry>
<heightmap>
<use_terrain_paging>false</use_terrain_paging>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer necessary

Suggested change
<use_terrain_paging>false</use_terrain_paging>

Comment on lines +155 to +156
<diffuse>materials/textures/rocks_diffuse.png</diffuse>
<normal>materials/textures/rocks_normal.png</normal>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like these are placed in the textures directory (no parent materials dir) inside half_dome_example. So we probably needs to either:

  • update these to textures/rocks_diffuse.png, or
  • add a parent materials directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

3 participants