mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 15:03:33 +08:00
tecs.cpp: tecs initialisation fixes (#411)
- zero thrust integrator on initialisation, we already have a cruise throttle variable - if initialising from in_air condition set last throttle setpoint to cruise throttle (_in_air ? throttle_cruise : 0.0f);
This commit is contained in:
committed by
Paul Riseborough
parent
35bc2cfcd9
commit
7964820412
+2
-2
@@ -522,9 +522,9 @@ void TECS::_initialize_states(float pitch, float throttle_cruise, float baro_alt
|
||||
_vert_pos_state = baro_altitude;
|
||||
_tas_rate_state = 0.0f;
|
||||
_tas_state = _EAS * EAS2TAS;
|
||||
_throttle_integ_state = (_in_air ? throttle_cruise : 0.0f);
|
||||
_throttle_integ_state = 0.0f;
|
||||
_pitch_integ_state = 0.0f;
|
||||
_last_throttle_setpoint = throttle_cruise;
|
||||
_last_throttle_setpoint = (_in_air ? throttle_cruise : 0.0f);;
|
||||
_last_pitch_setpoint = constrain(pitch, _pitch_setpoint_min, _pitch_setpoint_max);
|
||||
_pitch_setpoint_unc = _last_pitch_setpoint;
|
||||
_hgt_setpoint_adj_prev = baro_altitude;
|
||||
|
||||
Reference in New Issue
Block a user