This ROS-based package provides an elevation mapping pipeline that converts GeoTIFF data into a grid_map representation and publishes it as a ROS topic for visualization and integration with other planning or estimation components. The package is also structured to integrate with a custom single-state EKF update using rangefinder data from ArduPilot.
- Converts GeoTIFF terrain data to elevation maps with configurable resolution.
- Publishes the terrain as a ROS
grid_mapmessage. - Includes visualization support in RViz.
- Designed for integration with ArduPilot and future EKF updates using rangefinder data.
- Organized as a modular ROS 2 package with submodules for
grid_map.
├── terrain_mapping/ # Core terrain mapping package
│ ├── data/ # TIFF data input (GeoTIFFs)
│ ├── scripts/ # Python tools for loading terrain
│ ├── src/ # Main C++ source code
│ ├── include/ # Public headers
│ ├── config/ # YAML configuration files
│ ├── launch/ # ROS 2 launch files
│ ├── rviz/ # RViz visualization config
│ └── assets/ # Example RViz output
├── grid_map/ # Submodule: grid_map library (use Git submodule)
git clone --recurse-submodules https://github.com/snktshrma/terrain_mapper
cd terrain_mapperIf you already cloned without submodules:
git submodule update --init --recursiveInstall dependencies:
rosdep install --from-paths src -y --ignore-srcExample using gdalwarp:
gdalwarp \
-t_srs EPSG:32613 \
-te_srs EPSG:4326 \
-te -105.291603 40.053971 -105.287424 40.057020 \
-tr 1 1 \
-r bilinear \
<source.tif> \
<destination.tif>Place the output .tif inside the terrain_mapping/data/ directory.
colcon build --symlink-install
source install/setup.bashros2 launch terrain_mapping terrain_map.launch.pyUse the provided config:
ros2 run rviz2 rviz2 -d src/terrain_mapping/rviz/terrain_map.rvizAn upcoming feature adds a single-state EKF that:
- Takes ArduPilot rangefinder input.
- Updates the grid map in real time.
- Refines the terrain model adaptively.
- Initial GridMap publishing from GeoTIFF
- Elevation interpolation support
- EKF module implementation
- ArduPilot rangefinder data integration
- Live terrain map updating using EKF
- Final code completion and cleanup
- ROS 2 (tested with Humble)
gdal(CLI tools for GeoTIFF processing)- Eigen
- ANYbotics/grid_map
- Ensure terrain maps are projected properly (e.g., UTM).
- For submodule updates:
git submodule update --remoteMIT License
Sanket Sharma
For issues, open a GitHub issue or reach out directly.
