AP_TECS: move target land_airspeed logic to top layer

This commit is contained in:
Tom Pittenger 2016-04-13 09:10:29 -07:00
parent 525c7b24e3
commit 0af878703f

View File

@ -339,6 +339,7 @@ void AP_TECS::_update_speed(float load_factor)
// Convert equivalent airspeeds to true airspeeds // Convert equivalent airspeeds to true airspeeds
float EAS2TAS = _ahrs.get_EAS2TAS(); float EAS2TAS = _ahrs.get_EAS2TAS();
_TAS_dem = _EAS_dem * EAS2TAS;
_TASmax = aparm.airspeed_max * EAS2TAS; _TASmax = aparm.airspeed_max * EAS2TAS;
_TASmin = aparm.airspeed_min * EAS2TAS; _TASmin = aparm.airspeed_min * EAS2TAS;
@ -348,19 +349,6 @@ void AP_TECS::_update_speed(float load_factor)
_TASmin *= load_factor; _TASmin *= load_factor;
} }
float demanded_airspeed = _EAS_dem;
if (_ahrs.airspeed_sensor_enabled()) {
if ((_flight_stage == FLIGHT_LAND_APPROACH || _flight_stage == FLIGHT_LAND_FINAL) && _landAirspeed >= 0) {
demanded_airspeed = _landAirspeed;
} else if (_flight_stage == FLIGHT_LAND_PREFLARE) {
if (aparm.land_pre_flare_airspeed > 0) {
demanded_airspeed = aparm.land_pre_flare_airspeed;
} else if (_landAirspeed >= 0) {
demanded_airspeed = _landAirspeed;
}
}
}
_TAS_dem = demanded_airspeed * EAS2TAS;
if (_TASmax < _TASmin) { if (_TASmax < _TASmin) {
_TASmax = _TASmin; _TASmax = _TASmin;
} }