mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
drive-by bugfix in Fixedwingpathfollower
This commit is contained in:
parent
e18f2e6d7e
commit
9a52f506ef
@ -503,7 +503,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
|
|
||||||
// Error condition: plane cannot hold altitude at current speed.
|
// Error condition: plane cannot hold altitude at current speed.
|
||||||
fixedwingpathfollowerStatus.Errors.Lowpower = 0;
|
fixedwingpathfollowerStatus.Errors.Lowpower = 0;
|
||||||
if (powerCommand >= fixedwingpathfollowerSettings.ThrustLimit.Max && // thrust at maximum
|
if (fixedwingpathfollowerSettings.ThrustLimit.Neutral + powerCommand >= fixedwingpathfollowerSettings.ThrustLimit.Max && // thrust at maximum
|
||||||
velocityState.Down > 0 && // we ARE going down
|
velocityState.Down > 0 && // we ARE going down
|
||||||
descentspeedDesired < 0 && // we WANT to go up
|
descentspeedDesired < 0 && // we WANT to go up
|
||||||
airspeedError > 0 && // we are too slow already
|
airspeedError > 0 && // we are too slow already
|
||||||
@ -513,7 +513,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
}
|
}
|
||||||
// Error condition: plane keeps climbing despite minimum thrust (opposite of above)
|
// Error condition: plane keeps climbing despite minimum thrust (opposite of above)
|
||||||
fixedwingpathfollowerStatus.Errors.Highpower = 0;
|
fixedwingpathfollowerStatus.Errors.Highpower = 0;
|
||||||
if (powerCommand >= fixedwingpathfollowerSettings.ThrustLimit.Min && // thrust at minimum
|
if (fixedwingpathfollowerSettings.ThrustLimit.Neutral + powerCommand <= fixedwingpathfollowerSettings.ThrustLimit.Min && // thrust at minimum
|
||||||
velocityState.Down < 0 && // we ARE going up
|
velocityState.Down < 0 && // we ARE going up
|
||||||
descentspeedDesired > 0 && // we WANT to go down
|
descentspeedDesired > 0 && // we WANT to go down
|
||||||
airspeedError < 0 && // we are too fast already
|
airspeedError < 0 && // we are too fast already
|
||||||
@ -555,7 +555,7 @@ static uint8_t updateFixedDesiredAttitude()
|
|||||||
|
|
||||||
// Error condition: high speed dive
|
// Error condition: high speed dive
|
||||||
fixedwingpathfollowerStatus.Errors.Pitchcontrol = 0;
|
fixedwingpathfollowerStatus.Errors.Pitchcontrol = 0;
|
||||||
if (pitchCommand >= fixedwingpathfollowerSettings.PitchLimit.Max && // pitch demand is full up
|
if (fixedwingpathfollowerSettings.PitchLimit.Neutral + pitchCommand >= fixedwingpathfollowerSettings.PitchLimit.Max && // pitch demand is full up
|
||||||
velocityState.Down > 0 && // we ARE going down
|
velocityState.Down > 0 && // we ARE going down
|
||||||
descentspeedDesired < 0 && // we WANT to go up
|
descentspeedDesired < 0 && // we WANT to go up
|
||||||
airspeedError < 0 && // we are too fast already
|
airspeedError < 0 && // we are too fast already
|
||||||
|
Loading…
x
Reference in New Issue
Block a user