A lunar rover navigation system that finds safe driving paths across real NASA moon terrain data.
Given a map of the Moon's surface (a Digital Elevation Model, or DEM), LunaNav:
- Reads the terrain data (real NASA files or a built-in synthetic demo)
- Calculates which areas are safe to drive based on slope steepness
- Finds the shortest safe path between two points using the A* algorithm
- Saves a visualisation of the path as a PNG image
# Install dependencies pip install -r requirements.txt # Run the built-in demo (no data file needed) python main.py
This generates lunanav_path.png showing a rover path on a synthetic lunar surface.
Download a LOLA or SLDEM .img file from the NASA PDS Geosciences Node and run:
python main.py --img data/ldem_4.img
Load only a sub-region to save memory (useful for large files):
python main.py --img data/ldem_4.img --patch 0,1024,0,1024
| Flag | Default | Description |
|---|---|---|
--img |
(none) | Path to NASA PDS .img file |
--lbl |
(auto) | Path to .lbl label file |
--start |
(auto) | Start pixel as row,col |
--goal |
(auto) | Goal pixel as row,col |
--patch |
(none) | Sub-region to load: r0,r1,c0,c1 |
--max-pixels |
1024 |
Max DEM dimension after downsampling |
--max-slope |
20.0 |
Rover max safe slope in degrees |
--pixel-scale |
(auto) | Metres per pixel override |
--output |
lunanav_path.png |
Output image filename |
--no-show |
— | Skip interactive plot window |
--no-smooth |
— | Skip path smoothing |
- LOLA (
ldem_*) — 16-bit integer, PDS3 label - SLDEM (
sldem2015_*_float) — 32-bit float, PDS4 XML label - Auto-detects label file; falls back to filename-based parameter inference
lunanav/
dem_reader.py — reads NASA terrain files and generates synthetic DEMs
cost_map.py — computes per-pixel traversal cost from slope
pathfinder.py — A* search, path smoothing, and statistics
visualizer.py — plots the elevation map and rover path
main.py — command-line entry point
- Python 3.9+
- numpy, scipy, matplotlib (see
requirements.txt)