From 7f43facb37a22391d4f582affe703d19fe104372 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 12 Jan 2024 23:40:23 +1100 Subject: [PATCH] AP_TECS: make AHRS attitude member variables private --- libraries/AP_TECS/AP_TECS.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_TECS/AP_TECS.cpp b/libraries/AP_TECS/AP_TECS.cpp index 48f848c832..7ca3684625 100644 --- a/libraries/AP_TECS/AP_TECS.cpp +++ b/libraries/AP_TECS/AP_TECS.cpp @@ -856,7 +856,7 @@ void AP_TECS::_update_throttle_without_airspeed(int16_t throttle_nudge) // so that the throttle mapping adjusts for the effect of pitch control errors _pitch_demand_lpf.apply(_pitch_dem, _DT); const float pitch_demand_hpf = _pitch_dem - _pitch_demand_lpf.get(); - _pitch_measured_lpf.apply(_ahrs.pitch, _DT); + _pitch_measured_lpf.apply(_ahrs.get_pitch(), _DT); const float pitch_corrected_lpf = _pitch_measured_lpf.get() - radians(0.01f * (float)aparm.pitch_trim_cd); const float pitch_blended = pitch_demand_hpf + pitch_corrected_lpf; @@ -1107,7 +1107,7 @@ void AP_TECS::_initialise_states(int32_t ptchMinCO_cd, float hgt_afe) _integSEBdot = 0.0f; _integKE = 0.0f; _last_throttle_dem = aparm.throttle_cruise * 0.01f; - _last_pitch_dem = _ahrs.pitch; + _last_pitch_dem = _ahrs.get_pitch(); _hgt_afe = hgt_afe; _hgt_dem_in_prev = hgt_afe; _hgt_dem_lpf = hgt_afe; @@ -1138,8 +1138,8 @@ void AP_TECS::_initialise_states(int32_t ptchMinCO_cd, float hgt_afe) const float fc = 1.0f / (M_2PI * _timeConst); _pitch_demand_lpf.set_cutoff_frequency(fc); _pitch_measured_lpf.set_cutoff_frequency(fc); - _pitch_demand_lpf.reset(_ahrs.pitch); - _pitch_measured_lpf.reset(_ahrs.pitch); + _pitch_demand_lpf.reset(_ahrs.get_pitch()); + _pitch_measured_lpf.reset(_ahrs.get_pitch()); } else if (_flight_stage == AP_FixedWing::FlightStage::TAKEOFF || _flight_stage == AP_FixedWing::FlightStage::ABORT_LANDING) { _PITCHminf = 0.000174533f * ptchMinCO_cd; @@ -1159,8 +1159,8 @@ void AP_TECS::_initialise_states(int32_t ptchMinCO_cd, float hgt_afe) _max_climb_scaler = 1.0f; _max_sink_scaler = 1.0f; - _pitch_demand_lpf.reset(_ahrs.pitch); - _pitch_measured_lpf.reset(_ahrs.pitch); + _pitch_demand_lpf.reset(_ahrs.get_pitch()); + _pitch_measured_lpf.reset(_ahrs.get_pitch()); } if (_flight_stage != AP_FixedWing::FlightStage::TAKEOFF && _flight_stage != AP_FixedWing::FlightStage::ABORT_LANDING) {