Skip to content

Commit

Permalink
Align update rate for WP distance with XT error
Browse files Browse the repository at this point in the history
  • Loading branch information
breadoven committed Sep 2, 2024
1 parent 29244a4 commit 570b301
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/navigation/navigation_fixedwing.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta

if (isWaypointNavTrackingActive()) {
/* Calculate cross track error */
posControl.wpDistance = calculateDistanceToDestination(&posControl.activeWaypoint.pos);

fpVector3_t virtualCoursePoint;
virtualCoursePoint.x = posControl.activeWaypoint.pos.x -
posControl.wpDistance * cos_approx(CENTIDEGREES_TO_RADIANS(posControl.activeWaypoint.bearing));
Expand Down

0 comments on commit 570b301

Please sign in to comment.