mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 07:23:34 +08:00
TECS: fix: reset altitude reference model if we're using the height rate interface
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -745,8 +745,8 @@ void TECS::update(float pitch, float altitude, float hgt_setpoint, float EAS_set
|
|||||||
_airspeed_filter.update(dt, airspeed_input, _airspeed_filter_param, _control_flag.airspeed_enabled);
|
_airspeed_filter.update(dt, airspeed_input, _airspeed_filter_param, _control_flag.airspeed_enabled);
|
||||||
|
|
||||||
// Update Reference model submodule
|
// Update Reference model submodule
|
||||||
if (1.f - _fast_descend < FLT_EPSILON) {
|
if (1.f - _fast_descend < FLT_EPSILON || !PX4_ISFINITE(hgt_rate_sp)) {
|
||||||
// Reset the altitude reference model, while we are in fast descend.
|
// Reset the altitude reference model while we are in fast descend or in height rate control mode
|
||||||
const TECSAltitudeReferenceModel::AltitudeReferenceState init_state{
|
const TECSAltitudeReferenceModel::AltitudeReferenceState init_state{
|
||||||
.alt = altitude,
|
.alt = altitude,
|
||||||
.alt_rate = hgt_rate};
|
.alt_rate = hgt_rate};
|
||||||
|
|||||||
Reference in New Issue
Block a user