From e3b3713139bf843adaa5271db0cc5ba4d2ab2575 Mon Sep 17 00:00:00 2001 From: sambas Date: Sat, 27 Apr 2013 16:31:37 +0300 Subject: [PATCH] HiTL simulation solution for GPS update --- flight/modules/Attitude/revolution/attitude.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flight/modules/Attitude/revolution/attitude.c b/flight/modules/Attitude/revolution/attitude.c index 6f5bb2f08..922ec269e 100644 --- a/flight/modules/Attitude/revolution/attitude.c +++ b/flight/modules/Attitude/revolution/attitude.c @@ -587,8 +587,19 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode) mag_updated |= (xQueueReceive(magQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE); baro_updated |= xQueueReceive(baroQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE; airspeed_updated |= xQueueReceive(airspeedQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE; - gps_updated |= (xQueueReceive(gpsQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE) && outdoor_mode; - gps_vel_updated |= (xQueueReceive(gpsVelQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE) && outdoor_mode; + + // Check if we are running simulation + if (!GPSPositionReadOnly()) { + gps_updated |= (xQueueReceive(gpsQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE) && outdoor_mode; + } else { + gps_updated |= pdTRUE && outdoor_mode; + } + + if (!GPSVelocityReadOnly()) { + gps_vel_updated |= (xQueueReceive(gpsVelQueue, &ev, 0 / portTICK_RATE_MS) == pdTRUE) && outdoor_mode; + } else { + gps_vel_updated |= pdTRUE && outdoor_mode; + } // Get most recent data GyrosGet(&gyrosData);