mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
commander: don't start RTL on failsafe if landed
This commit is contained in:
@@ -1015,7 +1015,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
status_changed = true;
|
status_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update subsystem */
|
/* update position setpoint triplet */
|
||||||
orb_check(pos_sp_triplet_sub, &updated);
|
orb_check(pos_sp_triplet_sub, &updated);
|
||||||
|
|
||||||
if (updated) {
|
if (updated) {
|
||||||
@@ -1273,10 +1273,15 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* failsafe for manual modes */
|
/* failsafe for manual modes */
|
||||||
transition_result_t res = failsafe_state_transition(&status, FAILSAFE_STATE_RTL);
|
transition_result_t res = TRANSITION_DENIED;
|
||||||
|
|
||||||
|
if (!status.condition_landed) {
|
||||||
|
/* vehicle is not landed, try to perform RTL */
|
||||||
|
res = failsafe_state_transition(&status, FAILSAFE_STATE_RTL);
|
||||||
|
}
|
||||||
|
|
||||||
if (res == TRANSITION_DENIED) {
|
if (res == TRANSITION_DENIED) {
|
||||||
/* RTL not allowed (no global position estimate), try LAND */
|
/* RTL not allowed (no global position estimate) or not wanted, try LAND */
|
||||||
res = failsafe_state_transition(&status, FAILSAFE_STATE_LAND);
|
res = failsafe_state_transition(&status, FAILSAFE_STATE_LAND);
|
||||||
|
|
||||||
if (res == TRANSITION_DENIED) {
|
if (res == TRANSITION_DENIED) {
|
||||||
|
|||||||
Reference in New Issue
Block a user