AP_L1_Control: fixed waypoint approach logic

this could cause the RTL approach to not break off onto the circle
correctly
This commit is contained in:
Andrew Tridgell 2013-11-09 12:54:26 +11:00
parent 80def01fbe
commit 1393ed58d0
1 changed files with 2 additions and 1 deletions

View File

@ -260,7 +260,8 @@ void AP_L1_Control::update_loiter(const struct Location &center_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