diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 6531210bdd..3391f01e8e 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -789,12 +789,16 @@ FixedwingPositionControl::set_control_mode_current(const hrt_abstime &now) _control_mode_current = FW_POSCTRL_MODE_AUTO; } - } else if (_control_mode.flag_control_auto_enabled && _control_mode.flag_control_climb_rate_enabled - && pos_sp_curr_valid) { + } else if (_control_mode.flag_control_auto_enabled + && _control_mode.flag_control_climb_rate_enabled + && _control_mode.flag_armed // only enter this modes if armed, as pure failsafe modes + && !_control_mode.flag_control_position_enabled) { + + // failsafe modes engaged if position estimate is invalidated - // reset timer the first time we switch into this mode if (commanded_position_control_mode != FW_POSCTRL_MODE_AUTO_ALTITUDE && commanded_position_control_mode != FW_POSCTRL_MODE_AUTO_CLIMBRATE) { + // reset timer the first time we switch into this mode _time_in_fixed_bank_loiter = now; }