From 988d9173841c928cadd4795a7cf6888b052a378d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 26 Oct 2023 10:05:11 +1100 Subject: [PATCH] Rover: correct compilation if rangefinder disabled --- Rover/GCS_Mavlink.cpp | 2 ++ Rover/GCS_Mavlink.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Rover/GCS_Mavlink.cpp b/Rover/GCS_Mavlink.cpp index 2f691f01d9..7e7cc4f320 100644 --- a/Rover/GCS_Mavlink.cpp +++ b/Rover/GCS_Mavlink.cpp @@ -149,6 +149,7 @@ int16_t GCS_MAVLINK_Rover::vfr_hud_throttle() const return rover.g2.motors.get_throttle(); } +#if AP_RANGEFINDER_ENABLED void GCS_MAVLINK_Rover::send_rangefinder() const { float distance = 0; @@ -178,6 +179,7 @@ void GCS_MAVLINK_Rover::send_rangefinder() const distance, voltage); } +#endif // AP_RANGEFINDER_ENABLED /* send PID tuning message diff --git a/Rover/GCS_Mavlink.h b/Rover/GCS_Mavlink.h index f628bfa530..050109f5cc 100644 --- a/Rover/GCS_Mavlink.h +++ b/Rover/GCS_Mavlink.h @@ -58,7 +58,9 @@ private: int16_t vfr_hud_throttle() const override; +#if AP_RANGEFINDER_ENABLED void send_rangefinder() const override; +#endif #if HAL_HIGH_LATENCY2_ENABLED uint8_t high_latency_tgt_heading() const override;