AP_L1_Control: remove SpdHgt and use TECS direct

This commit is contained in:
Iampete1 2021-11-12 17:54:29 +00:00 committed by Andrew Tridgell
parent b9d240460b
commit 29455adab4
2 changed files with 6 additions and 6 deletions

View File

@ -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());

View File

@ -17,14 +17,14 @@
#include <AP_AHRS/AP_AHRS.h>
#include <AP_Param/AP_Param.h>
#include <AP_Navigation/AP_Navigation.h>
#include <AP_SpdHgtControl/AP_SpdHgtControl.h>
#include <AP_TECS/AP_TECS.h>
#include <AP_Common/Location.h>
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)