diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-02-02 22:04:11 +0100 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-02-02 22:04:11 +0100 |
commit | 3d21a73ddf18b89552aa9bd65965ff6b311487b8 (patch) | |
tree | 59957d65512c065c0bec3be531d6d70958adcd25 /src/modules/navigator/navigator_main.cpp | |
parent | 150bac4b51492b556b4e5e60236b3c239a1921db (diff) | |
download | px4-firmware-3d21a73ddf18b89552aa9bd65965ff6b311487b8.tar.gz px4-firmware-3d21a73ddf18b89552aa9bd65965ff6b311487b8.tar.bz2 px4-firmware-3d21a73ddf18b89552aa9bd65965ff6b311487b8.zip |
navigator: fixed infinite RTL->LOITER->RTL... loop on failsafe
Diffstat (limited to 'src/modules/navigator/navigator_main.cpp')
-rw-r--r-- | src/modules/navigator/navigator_main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 3ef2009c7..e0d5df5f7 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -688,7 +688,8 @@ Navigator::task_main() /* RETURN switch, overrides MISSION switch */ if (_vstatus.return_switch == RETURN_SWITCH_RETURN) { /* switch to RTL if not already landed after RTL and home position set */ - if (!(_rtl_state == RTL_STATE_DESCEND && (myState == NAV_STATE_READY || myState == NAV_STATE_LAND)) && + if (!(_rtl_state == RTL_STATE_DESCEND && + (myState == NAV_STATE_READY || myState == NAV_STATE_LAND || myState == NAV_STATE_LOITER)) && _vstatus.condition_home_position_valid) { dispatch(EVENT_RTL_REQUESTED); } @@ -746,7 +747,8 @@ Navigator::task_main() break; case NAV_STATE_RTL: - if (!(_rtl_state == RTL_STATE_DESCEND && (myState == NAV_STATE_READY || myState == NAV_STATE_LAND)) && + if (!(_rtl_state == RTL_STATE_DESCEND && + (myState == NAV_STATE_READY || myState == NAV_STATE_LAND || myState == NAV_STATE_LOITER)) && _vstatus.condition_home_position_valid) { dispatch(EVENT_RTL_REQUESTED); } |