mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-18 22:05:15 +03:00
Update navigation_fixedwing.c
This commit is contained in:
parent
e7f9f6e135
commit
d86ff58c94
1 changed files with 2 additions and 1 deletions
|
@ -394,12 +394,13 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
|
||||||
static int32_t previousHeadingError;
|
static int32_t previousHeadingError;
|
||||||
static bool errorIsDecreasing;
|
static bool errorIsDecreasing;
|
||||||
static bool forceTurnDirection = false;
|
static bool forceTurnDirection = false;
|
||||||
|
int32_t virtualTargetBearing;
|
||||||
|
|
||||||
if (FLIGHT_MODE(NAV_COURSE_HOLD_MODE)) {
|
if (FLIGHT_MODE(NAV_COURSE_HOLD_MODE)) {
|
||||||
virtualTargetBearing = posControl.desiredState.yaw;
|
virtualTargetBearing = posControl.desiredState.yaw;
|
||||||
} else {
|
} else {
|
||||||
// We have virtual position target, calculate heading error
|
// We have virtual position target, calculate heading error
|
||||||
int32_t virtualTargetBearing = calculateBearingToDestination(&virtualDesiredPosition);
|
virtualTargetBearing = calculateBearingToDestination(&virtualDesiredPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If waypoint tracking enabled quickly force craft toward waypoint course line and closely track along it */
|
/* If waypoint tracking enabled quickly force craft toward waypoint course line and closely track along it */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue