From 11e541f123ac0e39a33454baa0ce3f91fb8b7392 Mon Sep 17 00:00:00 2001 From: Asif Khan Date: Wed, 20 Sep 2023 11:56:20 +0530 Subject: [PATCH] AP_Terrain: add get_grid_spacing accessor --- libraries/AP_Terrain/AP_Terrain.h | 5 +++++ libraries/AP_Terrain/TerrainGCS.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Terrain/AP_Terrain.h b/libraries/AP_Terrain/AP_Terrain.h index 2321ba1350..ff55ce0dbb 100644 --- a/libraries/AP_Terrain/AP_Terrain.h +++ b/libraries/AP_Terrain/AP_Terrain.h @@ -182,6 +182,11 @@ public: */ void get_statistics(uint16_t &pending, uint16_t &loaded) const; + /* + get grid spacing in meters + */ + uint16_t get_grid_spacing() const { return MAX(grid_spacing, 0); }; + /* returns true if initialisation failed because out-of-memory */ diff --git a/libraries/AP_Terrain/TerrainGCS.cpp b/libraries/AP_Terrain/TerrainGCS.cpp index 8ad7ae352e..30a2067c29 100644 --- a/libraries/AP_Terrain/TerrainGCS.cpp +++ b/libraries/AP_Terrain/TerrainGCS.cpp @@ -196,7 +196,6 @@ void AP_Terrain::get_statistics(uint16_t &pending, uint16_t &loaded) const } } - /* handle terrain messages from GCS */