mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-21 15:25:29 +03:00
Do not raise THROTTLE during NAV_CTL_LAND when nose is UP
This commit is contained in:
parent
05cee111ff
commit
df619eb551
3 changed files with 14 additions and 2 deletions
|
@ -506,7 +506,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
|
||||||
[NAV_STATE_WAYPOINT_RTH_LAND] = {
|
[NAV_STATE_WAYPOINT_RTH_LAND] = {
|
||||||
.onEntry = navOnEnteringState_NAV_STATE_WAYPOINT_RTH_LAND,
|
.onEntry = navOnEnteringState_NAV_STATE_WAYPOINT_RTH_LAND,
|
||||||
.timeoutMs = 10,
|
.timeoutMs = 10,
|
||||||
.stateFlags = NAV_CTL_ALT | NAV_CTL_POS | NAV_CTL_YAW | NAV_REQUIRE_ANGLE | NAV_REQUIRE_MAGHOLD | NAV_REQUIRE_THRTILT | NAV_AUTO_WP,
|
.stateFlags = NAV_CTL_ALT | NAV_CTL_POS | NAV_CTL_YAW | NAV_CTL_LAND | NAV_REQUIRE_ANGLE | NAV_REQUIRE_MAGHOLD | NAV_REQUIRE_THRTILT | NAV_AUTO_WP,
|
||||||
.mapToFlightModes = NAV_WP_MODE | NAV_ALTHOLD_MODE,
|
.mapToFlightModes = NAV_WP_MODE | NAV_ALTHOLD_MODE,
|
||||||
.mwState = MW_NAV_STATE_LAND_IN_PROGRESS,
|
.mwState = MW_NAV_STATE_LAND_IN_PROGRESS,
|
||||||
.mwError = MW_NAV_ERROR_LANDING,
|
.mwError = MW_NAV_ERROR_LANDING,
|
||||||
|
|
|
@ -407,8 +407,17 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
|
||||||
if (isPitchAdjustmentValid && (navStateFlags & NAV_CTL_ALT)) {
|
if (isPitchAdjustmentValid && (navStateFlags & NAV_CTL_ALT)) {
|
||||||
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;
|
||||||
|
|
||||||
|
if (navStateFlags & NAV_CTL_LAND) {
|
||||||
|
/*
|
||||||
|
* During LAND we do not allow to raise THROTTLE when nose is up
|
||||||
|
* to reduce speed
|
||||||
|
*/
|
||||||
|
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, 0);
|
||||||
|
} else {
|
||||||
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
|
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Speed controller - only apply in POS mode
|
// Speed controller - only apply in POS mode
|
||||||
if (navStateFlags & NAV_CTL_POS) {
|
if (navStateFlags & NAV_CTL_POS) {
|
||||||
|
|
|
@ -230,6 +230,9 @@ typedef enum {
|
||||||
NAV_RC_ALT = (1 << 11),
|
NAV_RC_ALT = (1 << 11),
|
||||||
NAV_RC_POS = (1 << 12),
|
NAV_RC_POS = (1 << 12),
|
||||||
NAV_RC_YAW = (1 << 13),
|
NAV_RC_YAW = (1 << 13),
|
||||||
|
|
||||||
|
/* Additional flags */
|
||||||
|
NAV_CTL_LAND = (1 << 14),
|
||||||
} navigationFSMStateFlags_t;
|
} navigationFSMStateFlags_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue