|
|
|
@ -811,10 +811,6 @@ bool handle_command(struct vehicle_status_s *status_local, const struct safety_s
@@ -811,10 +811,6 @@ bool handle_command(struct vehicle_status_s *status_local, const struct safety_s
|
|
|
|
|
if (arming_ret == TRANSITION_DENIED) { |
|
|
|
|
mavlink_log_critical(&mavlink_log_pub, "Rejecting arming cmd"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (main_ret == TRANSITION_DENIED) { |
|
|
|
|
mavlink_log_critical(&mavlink_log_pub, "Rejecting mode switch cmd"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
@ -1959,7 +1955,7 @@ int commander_thread_main(int argc, char *argv[])
@@ -1959,7 +1955,7 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
if ((updated && status_flags.condition_local_altitude_valid) || check_for_disarming) { |
|
|
|
|
if (was_landed != land_detector.landed) { |
|
|
|
|
if (land_detector.landed) { |
|
|
|
|
if (land_detector.landed && armed.armed) { |
|
|
|
|
mavlink_and_console_log_info(&mavlink_log_pub, "LANDING DETECTED"); |
|
|
|
|
} else { |
|
|
|
|
mavlink_and_console_log_info(&mavlink_log_pub, "TAKEOFF DETECTED"); |
|
|
|
@ -2391,7 +2387,9 @@ int commander_thread_main(int argc, char *argv[])
@@ -2391,7 +2387,9 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
if ((internal_state.main_state != commander_state_s::MAIN_STATE_MANUAL) |
|
|
|
|
&& (internal_state.main_state != commander_state_s::MAIN_STATE_ACRO) |
|
|
|
|
&& (internal_state.main_state != commander_state_s::MAIN_STATE_STAB) |
|
|
|
|
&& (internal_state.main_state != commander_state_s::MAIN_STATE_ALTCTL)) { |
|
|
|
|
&& (internal_state.main_state != commander_state_s::MAIN_STATE_ALTCTL) |
|
|
|
|
&& (internal_state.main_state != commander_state_s::MAIN_STATE_POSCTL) |
|
|
|
|
) { |
|
|
|
|
print_reject_arm("NOT ARMING: Switch to a manual mode first."); |
|
|
|
|
|
|
|
|
|
} else if (!status_flags.condition_home_position_valid && |
|
|
|
@ -2413,7 +2411,7 @@ int commander_thread_main(int argc, char *argv[])
@@ -2413,7 +2411,7 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
arming_state_changed = true; |
|
|
|
|
} else { |
|
|
|
|
usleep(100000); |
|
|
|
|
print_reject_arm("NOT ARMING: Configuration error"); |
|
|
|
|
print_reject_arm("NOT ARMING: Preflight checks failed"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
stick_on_counter = 0; |
|
|
|
|