mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
Landing improvements only on targets with enought flash size
This commit is contained in:
parent
d729e73a7d
commit
2869d885f0
2 changed files with 7 additions and 0 deletions
|
@ -408,6 +408,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
|
||||||
pitchCorrection += posControl.rcAdjustment[PITCH];
|
pitchCorrection += posControl.rcAdjustment[PITCH];
|
||||||
throttleCorrection += DECIDEGREES_TO_DEGREES(pitchCorrection) * navConfig()->fw.pitch_to_throttle;
|
throttleCorrection += DECIDEGREES_TO_DEGREES(pitchCorrection) * navConfig()->fw.pitch_to_throttle;
|
||||||
|
|
||||||
|
#ifdef FIXED_WING_LANDING
|
||||||
if (navStateFlags & NAV_CTL_LAND) {
|
if (navStateFlags & NAV_CTL_LAND) {
|
||||||
/*
|
/*
|
||||||
* During LAND we do not allow to raise THROTTLE when nose is up
|
* 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);
|
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, 0);
|
||||||
} else {
|
} else {
|
||||||
|
#endif
|
||||||
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
|
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
|
||||||
|
#ifdef FIXED_WING_LANDING
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Speed controller - only apply in POS mode when NOT NAV_CTL_LAND
|
// 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);
|
rcCommand[THROTTLE] = constrain(correctedThrottleValue, motorConfig()->minthrottle, motorConfig()->maxthrottle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FIXED_WING_LANDING
|
||||||
/*
|
/*
|
||||||
* Then altitude is below landing slowdown min. altitude, enable final approach procedure
|
* 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
|
* 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]);
|
rcCommand[PITCH] = pidAngleToRcCommand(DEGREES_TO_DECIDEGREES(2), pidProfile()->max_angle_inclination[FD_PITCH]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (FLASH_SIZE > 128)
|
#if (FLASH_SIZE > 128)
|
||||||
|
#define FIXED_WING_LANDING
|
||||||
#define AUTOTUNE_FIXED_WING
|
#define AUTOTUNE_FIXED_WING
|
||||||
#define ASYNC_GYRO_PROCESSING
|
#define ASYNC_GYRO_PROCESSING
|
||||||
#define BOOTLOG
|
#define BOOTLOG
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue