diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-01 10:51:55 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-01 10:51:55 +0100 |
commit | 6af2ea9fbc019b023e2b1201b788c9185690e193 (patch) | |
tree | 9a782fcd1c74d4ccc44109c80e4f004e04cb5971 /apps/commander/commander.c | |
parent | 3c987d63680d153e4d954ad6249d24e5448e2204 (diff) | |
download | px4-firmware-6af2ea9fbc019b023e2b1201b788c9185690e193.tar.gz px4-firmware-6af2ea9fbc019b023e2b1201b788c9185690e193.tar.bz2 px4-firmware-6af2ea9fbc019b023e2b1201b788c9185690e193.zip |
Minor tweaks to offboard control reception
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r-- | apps/commander/commander.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c index e2478b4ec..fafbd7e94 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1523,12 +1523,14 @@ int commander_thread_main(int argc, char *argv[]) current_status.flag_control_manual_enabled = false; current_status.flag_control_offboard_enabled = true; state_changed = true; + tune_confirm(); - mavlink_log_critical(mavlink_fd, "[commander] DETECTED OFFBOARD CONTROL SIGNAL FIRST TIME."); + mavlink_log_critical(mavlink_fd, "[commander] DETECTED OFFBOARD CONTROL SIGNAL FIRST"); } else { if (current_status.offboard_control_signal_lost) { - mavlink_log_critical(mavlink_fd, "[commander] RECOVERY - OFFBOARD CONTROL SIGNAL GAINED!"); + mavlink_log_critical(mavlink_fd, "[commander] OK:RECOVERY OFFBOARD CONTROL"); state_changed = true; + tune_confirm(); } } @@ -1550,7 +1552,7 @@ int commander_thread_main(int argc, char *argv[]) /* print error message for first RC glitch and then every 5 s / 5000 ms) */ if (!current_status.offboard_control_signal_weak || ((hrt_absolute_time() - last_print_time) > 5000000)) { current_status.offboard_control_signal_weak = true; - mavlink_log_critical(mavlink_fd, "[commander] CRITICAL - NO OFFBOARD CONTROL SIGNAL!"); + mavlink_log_critical(mavlink_fd, "[commander] CRIT:NO OFFBOARD CONTROL!"); last_print_time = hrt_absolute_time(); } /* flag as lost and update interval since when the signal was lost (to initiate RTL after some time) */ @@ -1560,10 +1562,11 @@ int commander_thread_main(int argc, char *argv[]) if (current_status.offboard_control_signal_lost_interval > 100000) { current_status.offboard_control_signal_lost = true; current_status.failsave_lowlevel_start_time = hrt_absolute_time(); - current_status.failsave_lowlevel = true; + tune_confirm(); /* kill motors after timeout */ if (hrt_absolute_time() - current_status.failsave_lowlevel_start_time > failsafe_lowlevel_timeout_ms*1000) { + current_status.failsave_lowlevel = true; state_changed = true; } } |