diff --git a/libraries/AP_AHRS/AP_AHRS.cpp b/libraries/AP_AHRS/AP_AHRS.cpp index 8b57bc89d8..04adc4c7f0 100644 --- a/libraries/AP_AHRS/AP_AHRS.cpp +++ b/libraries/AP_AHRS/AP_AHRS.cpp @@ -211,3 +211,11 @@ bool AP_AHRS::get_projected_position(struct Location &loc) location_update(loc, degrees(yaw), _gps->ground_speed_cm * 0.01 * _gps->get_lag()); return true; } + +/* + get the GPS lag in seconds + */ +float AP_AHRS::get_position_lag(void) const +{ + return _gps->get_lag(); +} diff --git a/libraries/AP_AHRS/AP_AHRS.h b/libraries/AP_AHRS/AP_AHRS.h index 9ace4e6814..8152663d91 100644 --- a/libraries/AP_AHRS/AP_AHRS.h +++ b/libraries/AP_AHRS/AP_AHRS.h @@ -141,6 +141,9 @@ public: // heading and ground speed bool get_projected_position(struct Location &loc); + // return the estimated lag in our position due to GPS lag + float get_position_lag(void) const; + // return a wind estimation vector, in m/s virtual Vector3f wind_estimate(void) { return Vector3f(0,0,0);