mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 17:53:59 -04:00
AP_NavEKF: fixed airspeed estimate check
This commit is contained in:
parent
e69eea3086
commit
2dbfed19b8
@ -1768,12 +1768,9 @@ bool NavEKF::getLLH(struct Location &loc) const
|
||||
|
||||
void NavEKF::OnGroundCheck()
|
||||
{
|
||||
uint8_t lowAirSpd;
|
||||
uint8_t lowGndSpd;
|
||||
uint8_t lowHgt;
|
||||
lowAirSpd = (uint8_t)(_ahrs->airspeed_estimate_true(&VtasMeas) < 8.0f);
|
||||
lowGndSpd = (uint8_t)((sq(velNED[0]) + sq(velNED[1]) + sq(velNED[2])) < 4.0f);
|
||||
lowHgt = (uint8_t)(fabsf(hgtMea < 15.0f));
|
||||
uint8_t lowAirSpd = (!_ahrs->airspeed_estimate_true(&VtasMeas) || VtasMeas < 8.0f);
|
||||
uint8_t lowGndSpd = (uint8_t)((sq(velNED[0]) + sq(velNED[1]) + sq(velNED[2])) < 4.0f);
|
||||
uint8_t lowHgt = (uint8_t)(fabsf(hgtMea < 15.0f));
|
||||
// Go with a majority vote from three criteria
|
||||
onGround = ((lowAirSpd + lowGndSpd + lowHgt) >= 2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user