mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 08:36:08 +08:00
switching to prev main state after landing when disarmed
This commit is contained in:
committed by
Lorenz Meier
parent
fbf42c8949
commit
bfb862763c
@@ -2349,20 +2349,18 @@ int commander_thread_main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
/* handle main state after takeoff and land */
|
||||
/* reset main state after takeoff and land */
|
||||
if (status.main_state == vehicle_status_s::MAIN_STATE_AUTO_TAKEOFF
|
||||
&& mission_result.finished) {
|
||||
|
||||
// transition back to state we had before takeoff
|
||||
if (status.main_state_prev < vehicle_status_s::MAIN_STATE_MAX
|
||||
&& status.main_state_prev != vehicle_status_s::MAIN_STATE_AUTO_LAND) {
|
||||
main_state_transition(&status, status.main_state_prev);
|
||||
}
|
||||
|
||||
} else if (status.main_state == vehicle_status_s::MAIN_STATE_AUTO_LAND
|
||||
&& status.condition_landed) {
|
||||
&& status.arming_state == vehicle_status_s::ARMING_STATE_STANDBY) {
|
||||
|
||||
// transition back to state we had before takeoff
|
||||
if (status.main_state_prev < vehicle_status_s::MAIN_STATE_MAX
|
||||
&& status.main_state_prev != vehicle_status_s::MAIN_STATE_AUTO_TAKEOFF) {
|
||||
main_state_transition(&status, status.main_state_prev);
|
||||
|
||||
Reference in New Issue
Block a user