From 9e8d11e9e2a0b7fb394ad75fcd85d911c0905375 Mon Sep 17 00:00:00 2001 From: MrScothh <167884257+MrScothh@users.noreply.github.com> Date: Fri, 9 Oct 2026 10:28:45 +0200 Subject: [PATCH] navigation: fixed-wing autoland no longer skips the base leg setLandWaypoint() left posControl.wpDistance at the distance where the previous approach waypoint was declared reached, near zero. The FLY_BY corner cut in the position controller reads it before isWaypointReached() refreshes it, so it could judge the new waypoint already reached: the final approach then began at the turn point, to the side of the runway. --- src/main/navigation/navigation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/navigation/navigation.c b/src/main/navigation/navigation.c index 65fc16afd50..fc7c5e14517 100644 --- a/src/main/navigation/navigation.c +++ b/src/main/navigation/navigation.c @@ -7217,6 +7217,8 @@ static void setLandWaypoint(const fpVector3_t *pos, const fpVector3_t *nextWpPos } posControl.wpInitialDistance = calculateDistanceToDestination(&posControl.activeWaypoint.pos); + // Read by the FLY_BY corner cut before isWaypointReached() refreshes it: the old value skips this WP + posControl.wpDistance = posControl.wpInitialDistance; posControl.wpInitialAltitude = posControl.actualState.abs.pos.z; posControl.wpAltitudeReached = false; posControl.wpAltitudeEnforceActive = false;