Skip to content

snktshrma/terrain_mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terrain Mapping and Elevation Publisher with GridMap

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.

Features

  • Converts GeoTIFF terrain data to elevation maps with configurable resolution.
  • Publishes the terrain as a ROS grid_map message.
  • 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.

Repository Structure

├── 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)

Quick Start

1. Clone the repository with submodules

git clone --recurse-submodules https://github.com/snktshrma/terrain_mapper
cd terrain_mapper

If you already cloned without submodules:

git submodule update --init --recursive

Install dependencies:

rosdep install --from-paths src -y --ignore-src

2. Convert a GeoTIFF to 1m resolution using GDAL

Example 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.

3. Build the workspace

colcon build --symlink-install
source install/setup.bash

4. Run the terrain mapping node

ros2 launch terrain_mapping terrain_map.launch.py

5. Visualize in RViz

Use the provided config:

ros2 run rviz2 rviz2 -d src/terrain_mapping/rviz/terrain_map.rviz

Expected output: RViz Example

Planned Extension

EKF Terrain Estimation

An upcoming feature adds a single-state EKF that:

  • Takes ArduPilot rangefinder input.
  • Updates the grid map in real time.
  • Refines the terrain model adaptively.

Task Progress

  • 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

Dependencies

  • ROS 2 (tested with Humble)
  • gdal (CLI tools for GeoTIFF processing)
  • Eigen
  • ANYbotics/grid_map

Development Notes

  • Ensure terrain maps are projected properly (e.g., UTM).
  • For submodule updates:
git submodule update --remote

License

MIT License

Maintainer

Sanket Sharma

For issues, open a GitHub issue or reach out directly.

About

Terrain estimation and mapping using grid_map and single state EKF using ROS2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors