mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_NavEKF3: Fix bug preventing use of default or synthetic airspeed
This commit is contained in:
parent
2b027a7265
commit
568972c0f0
@ -868,7 +868,7 @@ void NavEKF3_core::readAirSpdData()
|
||||
// Allow use of a default value or a value synthesised from a stored wind velocity vector
|
||||
if (!useAirspeed()) {
|
||||
if (is_positive(defaultAirSpeed)) {
|
||||
if (imuDataDelayed.time_ms - tasDataDelayed.time_ms > 200) {
|
||||
if (imuDataDelayed.time_ms - lastTasPassTime_ms > 200) {
|
||||
tasDataDelayed.tas = defaultAirSpeed * EAS2TAS;
|
||||
tasDataDelayed.tasVariance = MAX(defaultAirSpeedVariance, sq(MAX(frontend->_easNoise, 0.5f)));
|
||||
tasDataToFuse = true;
|
||||
@ -877,7 +877,7 @@ void NavEKF3_core::readAirSpdData()
|
||||
tasDataToFuse = false;
|
||||
}
|
||||
} else if (windStateLastObsIsValid && !windStateIsObservable) {
|
||||
if (imuDataDelayed.time_ms - tasDataDelayed.time_ms > 200) {
|
||||
if (imuDataDelayed.time_ms - lastTasPassTime_ms > 200) {
|
||||
// use stored wind state to synthesise an airspeed measurement
|
||||
const Vector3F windRelVel = stateStruct.velocity - Vector3F(windStateLastObs.x, windStateLastObs.y, 0.0F);
|
||||
tasDataDelayed.tas = windRelVel.length();
|
||||
|
Loading…
Reference in New Issue
Block a user