Skip to content

Commit

Permalink
AP_TECS: Reverted TECS reset when pitch and throttle are forced
Browse files Browse the repository at this point in the history
  • Loading branch information
Georacer authored and Hwurzburg committed Sep 20, 2024
1 parent 40a6af8 commit 46c5013
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
10 changes: 0 additions & 10 deletions libraries/AP_TECS/AP_TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,6 @@ void AP_TECS::_initialise_states(float hgt_afe)
// Initialise states and variables if DT > 0.2 second or TECS is getting overriden or in climbout.
_flags.reset = false;

_need_reset = _need_reset || (_flag_pitch_forced && _flag_throttle_forced);

if (_DT > 0.2f || _need_reset) {
_SKE_weighting = 1.0f;
_integTHR_state = 0.0f;
Expand Down Expand Up @@ -1500,12 +1498,4 @@ void AP_TECS::_update_pitch_limits(const int32_t ptchMinCO_cd) {

// don't allow max pitch to go below min pitch
_PITCHmaxf = MAX(_PITCHmaxf, _PITCHminf);

// Test if someone is forcing pitch to a specific value.
const float pitch_eps = DEG_TO_RAD*1;
if (fabsf(_PITCHmaxf-_PITCHminf)<pitch_eps) {
_flag_pitch_forced = true;
} else {
_flag_pitch_forced = false;
}
}
2 changes: 0 additions & 2 deletions libraries/AP_TECS/AP_TECS.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,6 @@ class AP_TECS {

// need to reset on next loop
bool _need_reset;
// Flag if someone else drives pitch externally.
bool _flag_pitch_forced;
// Flag if someone else drives throttle externally.
bool _flag_throttle_forced;

Expand Down

0 comments on commit 46c5013

Please sign in to comment.