Skip to content

Commit

Permalink
AP_TECS: use ahrs EAS2TAS for true airspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tridgell committed Jul 22, 2013
1 parent ec73fad commit 620d067
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_TECS/AP_TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_TECS/AP_TECS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -98,9 +97,6 @@ class AP_TECS : public AP_SpdHgtControl {
// pointer to the AHRS object
AP_AHRS *_ahrs;

// pointer to the Baro object
AP_Baro *_baro;

const AP_SpdHgtControl::AircraftParameters &aparm;

// TECS tuning parameters
Expand Down

0 comments on commit 620d067

Please sign in to comment.