Skip to content

Commit

Permalink
Fix max climb rate during loiter
Browse files Browse the repository at this point in the history
  • Loading branch information
breadoven committed May 11, 2024
1 parent 0130368 commit 35ce764
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/navigation/navigation_fixedwing.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ static void updateAltitudeVelocityAndPitchController_FW(timeDelta_t deltaMicros)

float desiredClimbRate = getDesiredClimbRate(posControl.desiredState.pos.z, deltaMicros);

// Reduce max allowed climb pitch if performing loiter (stall prevention)
if (needToCalculateCircularLoiter && desiredClimbRate > 0.0f) {
desiredClimbRate *= 0.67f;
// Reduce max allowed climb rate by 2/3 if performing loiter (stall prevention)
if (needToCalculateCircularLoiter && desiredClimbRate > 0.67f * navConfig()->fw.max_auto_climb_rate) {
desiredClimbRate = 0.67f * navConfig()->fw.max_auto_climb_rate;
}

// Here we use negative values for dive for better clarity
Expand Down

0 comments on commit 35ce764

Please sign in to comment.