forked from Archive/PX4-Autopilot
commander: require home position for MISSION, fallback to LOITER
This commit is contained in:
parent
829a317d23
commit
06f08ad04d
|
@ -1718,6 +1718,13 @@ set_main_state_rc(struct vehicle_status_s *status, struct manual_control_setpoin
|
||||||
}
|
}
|
||||||
|
|
||||||
print_reject_mode(status, "AUTO_MISSION");
|
print_reject_mode(status, "AUTO_MISSION");
|
||||||
|
|
||||||
|
// fallback to LOITER if home position not set
|
||||||
|
res = main_state_transition(status, MAIN_STATE_AUTO_LOITER);
|
||||||
|
|
||||||
|
if (res != TRANSITION_DENIED) {
|
||||||
|
break; // changed successfully or already in this state
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallback to POSCTL
|
// fallback to POSCTL
|
||||||
|
|
|
@ -271,7 +271,6 @@ main_state_transition(struct vehicle_status_s *status, main_state_t new_main_sta
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAIN_STATE_AUTO_MISSION:
|
|
||||||
case MAIN_STATE_AUTO_LOITER:
|
case MAIN_STATE_AUTO_LOITER:
|
||||||
/* need global position estimate */
|
/* need global position estimate */
|
||||||
if (status->condition_global_position_valid) {
|
if (status->condition_global_position_valid) {
|
||||||
|
@ -279,6 +278,7 @@ main_state_transition(struct vehicle_status_s *status, main_state_t new_main_sta
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MAIN_STATE_AUTO_MISSION:
|
||||||
case MAIN_STATE_AUTO_RTL:
|
case MAIN_STATE_AUTO_RTL:
|
||||||
/* need global position and home position */
|
/* need global position and home position */
|
||||||
if (status->condition_global_position_valid && status->condition_home_position_valid) {
|
if (status->condition_global_position_valid && status->condition_home_position_valid) {
|
||||||
|
|
Loading…
Reference in New Issue