From c6ee948d604abe59ef49661c667709d4094681b6 Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Thu, 20 Sep 2012 15:48:22 +0900 Subject: [PATCH] AP_GPS: added get_lag method to return expected lag from the GPS. --- libraries/AP_GPS/AP_GPS_UBLOX.h | 2 ++ libraries/AP_GPS/GPS.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.h b/libraries/AP_GPS/AP_GPS_UBLOX.h index ae0f8a6672..be95d18ef5 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.h +++ b/libraries/AP_GPS/AP_GPS_UBLOX.h @@ -35,6 +35,8 @@ public: static const prog_char _ublox_set_binary[]; static const uint8_t _ublox_set_binary_size; + float get_lag() { return 0.5; } // ublox lag is lower than the default 1second + private: // u-blox UBX protocol essentials // XXX this is being ignored by the compiler #pragma pack(1) diff --git a/libraries/AP_GPS/GPS.h b/libraries/AP_GPS/GPS.h index 553ef4c41e..9e09633052 100644 --- a/libraries/AP_GPS/GPS.h +++ b/libraries/AP_GPS/GPS.h @@ -135,6 +135,8 @@ public: return _last_ground_speed_cm * 0.01; } + // the expected lag (in seconds) in the position and velocity readings from the gps + virtual float get_lag() { return 1.0; } // the time we got our last fix in system milliseconds uint32_t last_fix_time;