From 8b6593495c6e433b6e4c2bb6f600a76f85b3f3d2 Mon Sep 17 00:00:00 2001 From: tumbili Date: Sat, 23 May 2015 10:20:38 +0200 Subject: [PATCH] reset waypoints when switching to fw pos_ctrl mode --- src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index ec944c8b1d..d5360df6f0 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -1303,6 +1303,7 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi /* Need to init because last loop iteration was in a different mode */ _hold_alt = _global_pos.alt; _hdg_hold_yaw = _att.yaw; + _hdg_hold_enabled = false; // this makes sure the waypoints are reset below } /* Reset integrators if switching to this mode from a other mode in which posctl was not active */ if (_control_mode_current == FW_POSCTRL_MODE_OTHER) {