Skip to content

Commit 0eff393

Browse files
committed
AP_TECS: Don't run _update_pitch() if results are not used
1 parent 4fa8201 commit 0eff393

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/AP_TECS/AP_TECS.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,12 +1413,13 @@ void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm,
14131413
// Calculate specific energy quantitiues
14141414
_update_energies();
14151415

1416-
// Calculate pitch demand
1417-
_update_pitch();
14181416

14191417
if (option_is_set(Option::HGT_ACCLN_CTRL)) {
14201418
_update_throttle_accel(throttle_nudge, pitch_trim_deg);
14211419
} else {
1420+
// Calculate pitch demand
1421+
_update_pitch();
1422+
14221423
// Calculate throttle demand - use simple pitch to throttle if no
14231424
// airspeed sensor.
14241425
// Note that caller can demand the use of

0 commit comments

Comments
 (0)