From 918efc8f9764e0eb34307cb82d138a1bd37cc9ce Mon Sep 17 00:00:00 2001 From: Balduin Date: Fri, 20 Feb 2026 14:51:51 +0100 Subject: [PATCH] navigator: RTL: fix idle setpoint on activation (#26537) When switching modes, navigator resets the position setpoint triplet to idle. In the case of entering RTL, it is not replaced immediately by the correct triplet, but published once and only corrected a split second later. This causes zero thrust to come from control_idle in FixedWingModeManager Fix by calling run(true) on the appropriate sub-mode at the end of RTL::on_activation(), same as in the on_active just below. The submode is in inactive at that point, but run(true) triggers: - on_activation of the submode - set_rtl_item, which calls: - mission_item_to_position_setpoint - _navigator->set_position_setpoint_triplet_updated and therefore the navigator publishes the position setpoint triplet immediately (which was already being correctly set). Navigator: RTL: also update subs on actiavation Navigator: RTL: also disable mission RTL if direct RTL matching the logic in on_active exactly --- src/modules/navigator/rtl.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/navigator/rtl.cpp b/src/modules/navigator/rtl.cpp index 1420113437..468d7e9e78 100644 --- a/src/modules/navigator/rtl.cpp +++ b/src/modules/navigator/rtl.cpp @@ -220,6 +220,12 @@ void RTL::publishRemainingTimeEstimate() void RTL::on_activation() { + _global_pos_sub.update(); + _vehicle_status_sub.update(); + _mission_sub.update(); + _home_pos_sub.update(); + _wind_sub.update(); + setRtlTypeAndDestination(); switch (_rtl_type) { @@ -228,12 +234,21 @@ void RTL::on_activation() case RtlType::RTL_MISSION_FAST_REVERSE: if (_rtl_mission_type_handle) { _rtl_mission_type_handle->setReturnAltMin(_enforce_rtl_alt); + _rtl_mission_type_handle->run(true); } + _rtl_direct.run(false); + break; case RtlType::RTL_DIRECT: _rtl_direct.setReturnAltMin(_enforce_rtl_alt); + _rtl_direct.run(true); + + if (_rtl_mission_type_handle) { + _rtl_mission_type_handle->run(false); + } + break; default: