From 1393ed58d0da2ed39215d6fddc2c2de490a2203d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 9 Nov 2013 12:54:26 +1100 Subject: [PATCH] AP_L1_Control: fixed waypoint approach logic this could cause the RTL approach to not break off onto the circle correctly --- libraries/AP_L1_Control/AP_L1_Control.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_L1_Control/AP_L1_Control.cpp b/libraries/AP_L1_Control/AP_L1_Control.cpp index 555fd150f3..17d1bc754b 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.cpp +++ b/libraries/AP_L1_Control/AP_L1_Control.cpp @@ -260,7 +260,8 @@ void AP_L1_Control::update_loiter(const struct Location ¢er_WP, float radius // Perform switchover between 'capture' and 'circle' modes at the point where the commands cross over to achieve a seamless transfer // Only fly 'capture' mode if outside the circle - if ((latAccDemCap < latAccDemCirc && loiter_direction > 0 && xtrackErrCirc > 0.0f) | (latAccDemCap > latAccDemCirc && loiter_direction < 0 && xtrackErrCirc > 0.0f)) { + if ((latAccDemCap < latAccDemCirc && loiter_direction > 0 && xtrackErrCirc > 0.0f) || + (latAccDemCap > latAccDemCirc && loiter_direction < 0 && xtrackErrCirc > 0.0f)) { _latAccDem = latAccDemCap; _WPcircle = false; _bearing_error = Nu; // angle between demanded and achieved velocity vector, +ve to left of track