AP_TECS: use ahrs EAS2TAS for true airspeed

This commit is contained in:
Andrew Tridgell 2013-07-20 11:12:28 +10:00
parent ec73fadc45
commit 620d067ee1
2 changed files with 3 additions and 7 deletions

View File

@ -172,7 +172,7 @@ void AP_TECS::update_50hz(float hgt_afe)
// Update and average speed rate of change
// Only required if airspeed is being measured and controlled
float temp = 0;
if (_ahrs->airspeed_sensor_enabled() && _ahrs->airspeed_estimate(&_EAS)) {
if (_ahrs->airspeed_sensor_enabled() && _ahrs->airspeed_estimate_true(&_EAS)) {
// Get DCM
const Matrix3f &rotMat = _ahrs->get_dcm_matrix();
// Calculate speed rate of change
@ -194,7 +194,7 @@ void AP_TECS::_update_speed(void)
// Convert equivalent airspeeds to true airspeeds
float EAS2TAS = _baro->get_EAS2TAS();
float EAS2TAS = _ahrs->get_EAS2TAS();
_TAS_dem = _EAS_dem * EAS2TAS;
_TASmax = aparm.airspeed_max * EAS2TAS;
_TASmin = aparm.airspeed_min * EAS2TAS;

View File

@ -30,9 +30,8 @@
class AP_TECS : public AP_SpdHgtControl {
public:
AP_TECS(AP_AHRS *ahrs, AP_Baro *baro, const AP_SpdHgtControl::AircraftParameters &parms) :
AP_TECS(AP_AHRS *ahrs, const AP_SpdHgtControl::AircraftParameters &parms) :
_ahrs(ahrs),
_baro(baro),
aparm(parms)
{
AP_Param::setup_object_defaults(this, var_info);
@ -98,9 +97,6 @@ private:
// pointer to the AHRS object
AP_AHRS *_ahrs;
// pointer to the Baro object
AP_Baro *_baro;
const AP_SpdHgtControl::AircraftParameters &aparm;
// TECS tuning parameters