1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 01:05:21 +03:00

Landing improvements only on targets with enought flash size

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-05-31 11:11:01 +02:00
parent d729e73a7d
commit 2869d885f0
2 changed files with 7 additions and 0 deletions

View file

@ -408,6 +408,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
pitchCorrection += posControl.rcAdjustment[PITCH];
throttleCorrection += DECIDEGREES_TO_DEGREES(pitchCorrection) * navConfig()->fw.pitch_to_throttle;
#ifdef FIXED_WING_LANDING
if (navStateFlags & NAV_CTL_LAND) {
/*
* During LAND we do not allow to raise THROTTLE when nose is up
@ -415,8 +416,11 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
*/
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, 0);
} else {
#endif
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
#ifdef FIXED_WING_LANDING
}
#endif
}
// Speed controller - only apply in POS mode when NOT NAV_CTL_LAND
@ -443,6 +447,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
rcCommand[THROTTLE] = constrain(correctedThrottleValue, motorConfig()->minthrottle, motorConfig()->maxthrottle);
}
#ifdef FIXED_WING_LANDING
/*
* Then altitude is below landing slowdown min. altitude, enable final approach procedure
* TODO refactor conditions in this metod if logic is proven to be correct
@ -465,6 +470,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
*/
rcCommand[PITCH] = pidAngleToRcCommand(DEGREES_TO_DECIDEGREES(2), pidProfile()->max_angle_inclination[FD_PITCH]);
}
#endif
}
/*-----------------------------------------------------------

View file

@ -49,6 +49,7 @@
#endif
#if (FLASH_SIZE > 128)
#define FIXED_WING_LANDING
#define AUTOTUNE_FIXED_WING
#define ASYNC_GYRO_PROCESSING
#define BOOTLOG