diff --git a/Rover/GCS_Mavlink.cpp b/Rover/GCS_Mavlink.cpp index a8ad20a0a51459..ffa00067cecc79 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 f628bfa530bc4e..050109f5ccc3b3 100644 --- a/Rover/GCS_Mavlink.h +++ b/Rover/GCS_Mavlink.h @@ -58,7 +58,9 @@ class GCS_MAVLINK_Rover : public GCS_MAVLINK 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;