|
| 1 | +# Terrain |
| 2 | +``` |
| 3 | +┌─────────────────────────────────────────────────┐ |
| 4 | +│ ===Experimental=== │ |
| 5 | +│ This feature is experimental. Use it with │ |
| 6 | +│ caution. │ |
| 7 | +└─────────────────────────────────────────────────┘ |
| 8 | +``` |
| 9 | + |
| 10 | +This feature is available **only on H7-based and F4-based flight controllers with an SD card** (preferably SDIO). Due to the high CPU load |
| 11 | +and SD card read speed requirements of terrain data processing, it is not supported on weaker hardware. |
| 12 | + |
| 13 | +This feature in iNav determines the model’s altitude above ground level using preloaded elevation maps |
| 14 | +(terrain / SRTM data) stored on an SD card, without requiring a physical rangefinder. Based on the current GPS position, the |
| 15 | +flight controller identifies the corresponding point in the terrain map, calculates the ground elevation, and derives the |
| 16 | +altitude above terrain. |
| 17 | + |
| 18 | +In this first implementation, the calculated value is used **only for informational display in the OSD**. It is indicative |
| 19 | +only, does not yet behave as a true virtual rangefinder, and is not used for navigation or automatic altitude control. If the |
| 20 | +terrain data are unavailable or a read error occurs, the feature is automatically disabled. |
| 21 | + |
| 22 | +# SD Card Preparation |
| 23 | + |
| 24 | +For proper operation, the SD card must be prepared in advance. It is recommended to create a **partition with a maximum size |
| 25 | +of 4 GB** and format it. Formatting should be done using the official |
| 26 | +[**SD Memory Card Formatter**](https://www.sdcard.org/downloads/formatter/sd-memory-card-formatter-for-windows-download/) tool from the SD Association, |
| 27 | +which ensures correct alignment and a compatible file system structure. Using this tool minimizes the risk of terrain data |
| 28 | +read issues during flight and is considered the recommended method for preparing an SD card for iNav. |
| 29 | + |
| 30 | +# Data Generation and Copying |
| 31 | + |
| 32 | +To generate elevation maps, use the terrain generator web tool available at https://terrain.ardupilot.org/ |
| 33 | + |
| 34 | +In iNav, **only 30 m resolution (SRTM1)** is currently supported, so this option must be selected during data generation. |
| 35 | +The generated files are then copied to the SD card into the appropriate directory structure. |
| 36 | + |
| 37 | +Copying can be done via **iNav MSC (Mass Storage Class)**, but this method is very slow, so using an **external SD card reader** |
| 38 | +is strongly recommended. Before copying the data, the file **`FREESPAC.E`** must be deleted from the root directory of the SD |
| 39 | +card. iNav uses this file to track available disk space, and without deleting it, the card may appear to be full. After the |
| 40 | +copying process is complete, iNav will automatically recreate this file on the next startup. |
| 41 | + |
| 42 | +# Enabling and Displaying Terrain Data |
| 43 | + |
| 44 | +To display altitude above terrain in iNav, the OSD element **“Rangefinder distance”** must be enabled. If terrain data are |
| 45 | +available on the SD card and no valid data are available from a dedicated rangefinder, the value calculated by the terrain |
| 46 | +system will be displayed. If a rangefinder is present and providing valid data, its measurements always take priority and the |
| 47 | +actual distance to the ground will be shown. |
| 48 | + |
| 49 | +Loading terrain data from the SD card is enabled via the CLI using the following command: |
| 50 | + |
| 51 | +```text |
| 52 | +set terrain_enabled = ON |
| 53 | +save |
| 54 | +``` |
| 55 | + |
| 56 | +After restarting the flight controller, iNav will automatically start loading terrain data and, when conditions are met, use |
| 57 | +them to display altitude above terrain. |
| 58 | + |
| 59 | +Finally, it is **strongly recommended to use only high-quality, branded SD cards** from reputable manufacturers. The terrain |
| 60 | +system is sensitive to SD card read speed and reliability, and low-quality or counterfeit cards may cause read errors, |
| 61 | +display dropouts, or automatic disabling of the feature during flight. Using a quality SD card significantly improves the |
| 62 | +stability and reliability of the terrain feature. |
| 63 | + |
| 64 | +# TL;DR |
| 65 | + |
| 66 | +- **H7/F4 flight controller** with SD card required |
| 67 | +- Format SD card using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/sd-memory-card-formatter-for-windows-download/) (max 4 GB partition) |
| 68 | +- Generate terrain data at https://terrain.ardupilot.org/ — select **SRTM1 (30 m)** |
| 69 | +- Delete `FREESPAC.E` from SD card root before copying files (use external card reader, not MSC) |
| 70 | +- Enable via CLI: `set terrain_enabled = ON` + `save` |
| 71 | +- Enable **Rangefinder distance** OSD element to see altitude above terrain |
| 72 | +- ⚠️ Displayed value is **informational only** — not used for navigation or altitude control |
| 73 | +- Use only **high-quality branded SD cards** |
0 commit comments