AHRS: limit wind speed estimate changes

sudden yaw changes can cause bad wind estimates
This commit is contained in:
Andrew Tridgell 2012-09-26 20:50:07 +10:00
parent 0495a0debc
commit 00bf548f87
1 changed files with 3 additions and 1 deletions

View File

@ -624,7 +624,9 @@ void AP_AHRS_DCM::estimate_wind(Vector3f &velocity)
wind.z = velocitySum.z - V * fuselageDirectionSum.z;
wind *= 0.5;
_wind = _wind * 0.95 + wind * 0.05;
if (wind.length() < _wind.length() + 20) {
_wind = _wind * 0.95 + wind * 0.05;
}
_last_wind_time = now;
} else if (now - _last_wind_time > 2000 && _airspeed && _airspeed->use()) {