mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 01:35:35 +03:00
Merge pull request #6724 from breadoven/abo_fix_man_mode_WP_mission
Ensure Manual mode activates during active WP mission
This commit is contained in:
commit
d93c443f6f
2 changed files with 5 additions and 4 deletions
|
@ -87,7 +87,7 @@
|
||||||
#define OSD_MSG_HOLDING_WAYPOINT "HOLDING WAYPOINT"
|
#define OSD_MSG_HOLDING_WAYPOINT "HOLDING WAYPOINT"
|
||||||
#define OSD_MSG_TO_WP "TO WP"
|
#define OSD_MSG_TO_WP "TO WP"
|
||||||
#define OSD_MSG_PREPARE_NEXT_WP "PREPARING FOR NEXT WAYPOINT"
|
#define OSD_MSG_PREPARE_NEXT_WP "PREPARING FOR NEXT WAYPOINT"
|
||||||
#define OSD_MSG_WP_RTH_CANCEL "CANCEL WP MODE TO EXIT RTH"
|
#define OSD_MSG_WP_RTH_CANCEL "CANCEL WP TO EXIT RTH"
|
||||||
#define OSD_MSG_EMERG_LANDING "EMERGENCY LANDING"
|
#define OSD_MSG_EMERG_LANDING "EMERGENCY LANDING"
|
||||||
#define OSD_MSG_LANDING "LANDING"
|
#define OSD_MSG_LANDING "LANDING"
|
||||||
#define OSD_MSG_LOITERING_HOME "LOITERING AROUND HOME"
|
#define OSD_MSG_LOITERING_HOME "LOITERING AROUND HOME"
|
||||||
|
|
|
@ -3186,15 +3186,16 @@ static navigationFSMEvent_t selectNavEventFromBoxModeInput(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RTH/Failsafe_RTH can override MANUAL
|
// Failsafe_RTH (can override MANUAL)
|
||||||
if (posControl.flags.forcedRTHActivated) {
|
if (posControl.flags.forcedRTHActivated) {
|
||||||
// If we request forced RTH - attempt to activate it no matter what
|
// If we request forced RTH - attempt to activate it no matter what
|
||||||
// This might switch to emergency landing controller if GPS is unavailable
|
// This might switch to emergency landing controller if GPS is unavailable
|
||||||
return NAV_FSM_EVENT_SWITCH_TO_RTH;
|
return NAV_FSM_EVENT_SWITCH_TO_RTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pilot-triggered RTH, also fall-back for WP if there is no mission loaded
|
// Pilot-triggered RTH (can override MANUAL), also fall-back for WP if there is no mission loaded
|
||||||
if (IS_RC_MODE_ACTIVE(BOXNAVRTH) || (IS_RC_MODE_ACTIVE(BOXNAVWP) && !canActivateWaypoint)) {
|
// Prevent MANUAL falling back to RTH if selected during active mission (canActivateWaypoint is set false on MANUAL selection)
|
||||||
|
if (IS_RC_MODE_ACTIVE(BOXNAVRTH) || (IS_RC_MODE_ACTIVE(BOXNAVWP) && !canActivateWaypoint && !IS_RC_MODE_ACTIVE(BOXMANUAL))) {
|
||||||
// Check for isExecutingRTH to prevent switching our from RTH in case of a brief GPS loss
|
// Check for isExecutingRTH to prevent switching our from RTH in case of a brief GPS loss
|
||||||
// If don't keep this, loss of any of the canActivatePosHold && canActivateNavigation && canActivateAltHold
|
// If don't keep this, loss of any of the canActivatePosHold && canActivateNavigation && canActivateAltHold
|
||||||
// will kick us out of RTH state machine via NAV_FSM_EVENT_SWITCH_TO_IDLE and will prevent any of the fall-back
|
// will kick us out of RTH state machine via NAV_FSM_EVENT_SWITCH_TO_IDLE and will prevent any of the fall-back
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue