From 29455adab4af04f7e79766dec91691362732eafb Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 12 Nov 2021 17:54:29 +0000 Subject: [PATCH] AP_L1_Control: remove SpdHgt and use TECS direct --- libraries/AP_L1_Control/AP_L1_Control.cpp | 4 ++-- libraries/AP_L1_Control/AP_L1_Control.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_L1_Control/AP_L1_Control.cpp b/libraries/AP_L1_Control/AP_L1_Control.cpp index 567b04efe1..a3797d5315 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.cpp +++ b/libraries/AP_L1_Control/AP_L1_Control.cpp @@ -142,10 +142,10 @@ float AP_L1_Control::loiter_radius(const float radius) const float lateral_accel_sea_level = tanf(radians(sanitized_bank_limit)) * GRAVITY_MSS; float nominal_velocity_sea_level; - if(_spdHgtControl == nullptr) { + if(_tecs == nullptr) { nominal_velocity_sea_level = 0.0f; } else { - nominal_velocity_sea_level = _spdHgtControl->get_target_airspeed(); + nominal_velocity_sea_level = _tecs->get_target_airspeed(); } float eas2tas_sq = sq(_ahrs.get_EAS2TAS()); diff --git a/libraries/AP_L1_Control/AP_L1_Control.h b/libraries/AP_L1_Control/AP_L1_Control.h index ca57823f52..34814fd73e 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.h +++ b/libraries/AP_L1_Control/AP_L1_Control.h @@ -17,14 +17,14 @@ #include #include #include -#include +#include #include class AP_L1_Control : public AP_Navigation { public: - AP_L1_Control(AP_AHRS &ahrs, const AP_SpdHgtControl *spdHgtControl) + AP_L1_Control(AP_AHRS &ahrs, const AP_TECS *tecs) : _ahrs(ahrs) - , _spdHgtControl(spdHgtControl) + , _tecs(tecs) { AP_Param::setup_object_defaults(this, var_info); } @@ -81,7 +81,7 @@ private: AP_AHRS &_ahrs; // pointer to the SpdHgtControl object - const AP_SpdHgtControl *_spdHgtControl; + const AP_TECS *_tecs; // lateral acceration in m/s required to fly to the // L1 reference point (+ve to right)