Skip to content
Snippets Groups Projects
Commit c56f3a9f authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

AHRS: limit wind speed estimate changes

sudden yaw changes can cause bad wind estimates
parent d1f0b382
No related branches found
No related tags found
No related merge requests found
......@@ -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()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment