mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
Bug fix
Multiple RTH and early exit from RTH fixed. Message would only be displayed for first RTH.
This commit is contained in:
parent
a47afe2187
commit
62d78ae7c2
2 changed files with 7 additions and 4 deletions
|
@ -1001,6 +1001,9 @@ static const char * divertingToSafehomeMessage(void)
|
||||||
|
|
||||||
static const char * navigationStateMessage(void)
|
static const char * navigationStateMessage(void)
|
||||||
{
|
{
|
||||||
|
if (!posControl.rthState.rthLinearDescentActive && linearDescentMessageMs != 0)
|
||||||
|
linearDescentMessageMs = 0;
|
||||||
|
|
||||||
switch (NAV_Status.state) {
|
switch (NAV_Status.state) {
|
||||||
case MW_NAV_STATE_NONE:
|
case MW_NAV_STATE_NONE:
|
||||||
break;
|
break;
|
||||||
|
@ -1060,9 +1063,6 @@ static const char * navigationStateMessage(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!posControl.rthState.rthLinearDescentActive && linearDescentMessageMs != 0)
|
|
||||||
linearDescentMessageMs = 0;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1227,6 +1227,9 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_INITIALIZE(navigati
|
||||||
{
|
{
|
||||||
UNUSED(previousState);
|
UNUSED(previousState);
|
||||||
|
|
||||||
|
if (navConfig()->general.flags.rth_use_linear_descent && posControl.rthState.rthLinearDescentActive)
|
||||||
|
posControl.rthState.rthLinearDescentActive = false;
|
||||||
|
|
||||||
if ((posControl.flags.estHeadingStatus == EST_NONE) || (posControl.flags.estAltStatus == EST_NONE) || !STATE(GPS_FIX_HOME)) {
|
if ((posControl.flags.estHeadingStatus == EST_NONE) || (posControl.flags.estAltStatus == EST_NONE) || !STATE(GPS_FIX_HOME)) {
|
||||||
// Heading sensor, altitude sensor and HOME fix are mandatory for RTH. If not satisfied - switch to emergency landing
|
// Heading sensor, altitude sensor and HOME fix are mandatory for RTH. If not satisfied - switch to emergency landing
|
||||||
// Relevant to failsafe forced RTH only. Switched RTH blocked in selectNavEventFromBoxModeInput if sensors unavailable.
|
// Relevant to failsafe forced RTH only. Switched RTH blocked in selectNavEventFromBoxModeInput if sensors unavailable.
|
||||||
|
@ -1444,7 +1447,7 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_HEAD_HOME(navigatio
|
||||||
// Successfully reached position target - update XYZ-position
|
// Successfully reached position target - update XYZ-position
|
||||||
setDesiredPosition(tmpHomePos, posControl.rthState.homePosition.heading, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING);
|
setDesiredPosition(tmpHomePos, posControl.rthState.homePosition.heading, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING);
|
||||||
|
|
||||||
if (navConfig()->general.flags.rth_use_linear_descent)
|
if (navConfig()->general.flags.rth_use_linear_descent && posControl.rthState.rthLinearDescentActive)
|
||||||
posControl.rthState.rthLinearDescentActive = false;
|
posControl.rthState.rthLinearDescentActive = false;
|
||||||
|
|
||||||
return NAV_FSM_EVENT_SUCCESS; // NAV_STATE_RTH_HOVER_PRIOR_TO_LANDING
|
return NAV_FSM_EVENT_SUCCESS; // NAV_STATE_RTH_HOVER_PRIOR_TO_LANDING
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue