|
|
|
@ -1226,7 +1226,8 @@ int commander_thread_main(int argc, char *argv[])
@@ -1226,7 +1226,8 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
status.condition_system_sensors_initialized = false; |
|
|
|
|
set_tune_override(TONE_STARTUP_TUNE); //normal boot tune
|
|
|
|
|
} else { |
|
|
|
|
status.condition_system_sensors_initialized = Commander::preflightCheck(mavlink_fd, true, true, true, true, checkAirspeed, !status.rc_input_mode, !status.circuit_breaker_engaged_gpsfailure_check); |
|
|
|
|
status.condition_system_sensors_initialized = Commander::preflightCheck(mavlink_fd, true, true, true, true, |
|
|
|
|
checkAirspeed, !status.rc_input_mode, !status.circuit_breaker_engaged_gpsfailure_check); |
|
|
|
|
if (!status.condition_system_sensors_initialized) { |
|
|
|
|
set_tune_override(TONE_GPS_WARNING_TUNE); //sensor fail tune
|
|
|
|
|
} |
|
|
|
@ -1863,17 +1864,16 @@ int commander_thread_main(int argc, char *argv[])
@@ -1863,17 +1864,16 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* RC input check */ |
|
|
|
|
if (!(status.rc_input_mode == vehicle_status_s::RC_IN_MODE_OFF) && !status.rc_input_blocked && sp_man.timestamp != 0 && |
|
|
|
|
hrt_absolute_time() < sp_man.timestamp + (uint64_t)(rc_loss_timeout * 1e6f)) { |
|
|
|
|
if (!status.rc_input_blocked && sp_man.timestamp != 0 && |
|
|
|
|
(hrt_absolute_time() < sp_man.timestamp + (uint64_t)(rc_loss_timeout * 1e6f))) { |
|
|
|
|
/* handle the case where RC signal was regained */ |
|
|
|
|
if (!status.rc_signal_found_once) { |
|
|
|
|
status.rc_signal_found_once = true; |
|
|
|
|
mavlink_log_info(mavlink_fd, "Detected radio control"); |
|
|
|
|
status_changed = true; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
if (status.rc_signal_lost) { |
|
|
|
|
mavlink_log_info(mavlink_fd, "RC SIGNAL REGAINED after %llums", |
|
|
|
|
mavlink_log_info(mavlink_fd, "MANUAL CONTROL REGAINED after %llums", |
|
|
|
|
(hrt_absolute_time() - status.rc_signal_lost_timestamp) / 1000); |
|
|
|
|
status_changed = true; |
|
|
|
|
} |
|
|
|
@ -1979,7 +1979,7 @@ int commander_thread_main(int argc, char *argv[])
@@ -1979,7 +1979,7 @@ int commander_thread_main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
if (!status.rc_signal_lost) { |
|
|
|
|
mavlink_log_critical(mavlink_fd, "RC SIGNAL LOST (at t=%llums)", hrt_absolute_time() / 1000); |
|
|
|
|
mavlink_log_critical(mavlink_fd, "MANUAL CONTROL LOST (at t=%llums)", hrt_absolute_time() / 1000); |
|
|
|
|
status.rc_signal_lost = true; |
|
|
|
|
status.rc_signal_lost_timestamp = sp_man.timestamp; |
|
|
|
|
status_changed = true; |
|
|
|
|