mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Some cleanups
This commit is contained in:
parent
8b7a14aea7
commit
7ce1872b25
1 changed files with 11 additions and 11 deletions
|
@ -797,6 +797,8 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_INITIALIZE(navigati
|
||||||
return NAV_FSM_EVENT_SWITCH_TO_IDLE;
|
return NAV_FSM_EVENT_SWITCH_TO_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have valid position sensor or configured to ignore it's loss at initial stage - continue
|
||||||
|
if (posControl.flags.hasValidPositionSensor || navConfig()->general.flags.rth_climb_ignore_emerg) {
|
||||||
// Reset altitude and position controllers if necessary
|
// Reset altitude and position controllers if necessary
|
||||||
if ((prevFlags & NAV_CTL_POS) == 0) {
|
if ((prevFlags & NAV_CTL_POS) == 0) {
|
||||||
resetPositionController();
|
resetPositionController();
|
||||||
|
@ -807,8 +809,6 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_INITIALIZE(navigati
|
||||||
setupAltitudeController();
|
setupAltitudeController();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have valid position sensor or configured to ignore it's loss at initial stage - continue
|
|
||||||
if (posControl.flags.hasValidPositionSensor || navConfig()->general.flags.rth_climb_ignore_emerg) {
|
|
||||||
// If close to home - reset home position and land
|
// If close to home - reset home position and land
|
||||||
if (posControl.homeDistance < navConfig()->general.min_rth_distance) {
|
if (posControl.homeDistance < navConfig()->general.min_rth_distance) {
|
||||||
setHomePosition(&posControl.actualState.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_HEADING);
|
setHomePosition(&posControl.actualState.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_HEADING);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue