From a2ecaf737dd08e601456c1278f355b8d0a6e6618 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 20 Jun 2023 18:38:59 +1000 Subject: [PATCH] GCS_MAVLink: correct define around use of ins singleton --- libraries/GCS_MAVLink/GCS.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index fa604ad47df64..7ff1e7ec3ca42 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -149,9 +149,12 @@ void GCS::update_sensor_status_flags() control_sensors_enabled = 0; control_sensors_health = 0; -#if AP_AHRS_ENABLED - AP_AHRS &ahrs = AP::ahrs(); +#if AP_INERTIALSENSOR_ENABLED const AP_InertialSensor &ins = AP::ins(); +#endif + +#if AP_AHRS_ENABLED && AP_INERTIALSENSOR_ENABLED + AP_AHRS &ahrs = AP::ahrs(); control_sensors_present |= MAV_SYS_STATUS_AHRS; if (ahrs.initialised()) { @@ -206,7 +209,7 @@ void GCS::update_sensor_status_flags() } #endif -#if AP_AHRS_ENABLED +#if AP_INERTIALSENSOR_ENABLED control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_GYRO; control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; if (!ins.calibrating()) {