From 5f039ba06d9a8347d405ca767cefa7a1ed89f97d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 12 Jul 2021 20:25:30 +1000 Subject: [PATCH] Copter: fix build for lack of AC_TERRAIN define --- ArduCopter/Parameters.cpp | 2 +- ArduCopter/Parameters.h | 2 +- ArduCopter/terrain.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index bfef06a5c6..f38a7fa4a8 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1079,7 +1079,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { AP_GROUPINFO("GUID_TIMEOUT", 46, ParametersG2, guided_timeout, 3.0), #endif -#if AP_TERRAIN_AVAILABLE && AC_TERRAIN +#if AP_TERRAIN_AVAILABLE // @Param: TERRAIN_MARGIN // @DisplayName: Terrain following altitude margin // @Description: Terrain following altitude margin. Vehicle will stop if distance from target altitude is larger than this margin (in meters) diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 9e91f52240..6f5f96a965 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -653,7 +653,7 @@ public: AP_Float guided_timeout; #endif -#if AP_TERRAIN_AVAILABLE && AC_TERRAIN +#if AP_TERRAIN_AVAILABLE AP_Float terrain_margin; #endif }; diff --git a/ArduCopter/terrain.cpp b/ArduCopter/terrain.cpp index 4d94836a94..0dcccc652f 100644 --- a/ArduCopter/terrain.cpp +++ b/ArduCopter/terrain.cpp @@ -30,7 +30,7 @@ void Copter::terrain_logging() // return terrain following altitude margin. Vehicle will stop if distance from target altitude is larger than this margin (in meters) float Copter::get_terrain_margin() const { -#if AP_TERRAIN_AVAILABLE && AC_TERRAIN +#if AP_TERRAIN_AVAILABLE return MAX(g2.terrain_margin.get(), 0.1); #else return 10;