mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 15:03:33 +08:00
commander: Added duration of rc-loss to mavlink_log_critical message
This commit is contained in:
@@ -1499,7 +1499,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (status.rc_signal_lost) {
|
if (status.rc_signal_lost) {
|
||||||
mavlink_log_critical(mavlink_fd, "RC SIGNAL REGAINED (at t=%.3fs)",(double)(hrt_absolute_time())/1.0e6);
|
mavlink_log_critical(mavlink_fd, "RC SIGNAL REGAINED after %.3fs (at t=%.3fs)",(double)(hrt_absolute_time()-status.rc_signal_lost_timestamp)/1.0e6,(double)(hrt_absolute_time())/1.0e6);
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1594,6 +1594,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
if (!status.rc_signal_lost) {
|
if (!status.rc_signal_lost) {
|
||||||
mavlink_log_critical(mavlink_fd, "RC SIGNAL LOST (at t=%.3fs)",(double)(hrt_absolute_time())/1.0e6);
|
mavlink_log_critical(mavlink_fd, "RC SIGNAL LOST (at t=%.3fs)",(double)(hrt_absolute_time())/1.0e6);
|
||||||
status.rc_signal_lost = true;
|
status.rc_signal_lost = true;
|
||||||
|
status.rc_signal_lost_timestamp=sp_man.timestamp;
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ struct vehicle_status_s {
|
|||||||
|
|
||||||
bool rc_signal_found_once;
|
bool rc_signal_found_once;
|
||||||
bool rc_signal_lost; /**< true if RC reception lost */
|
bool rc_signal_lost; /**< true if RC reception lost */
|
||||||
|
uint64_t rc_signal_lost_timestamp; /**< Time at which the RC reception was lost */
|
||||||
bool rc_signal_lost_cmd; /**< true if RC lost mode is commanded */
|
bool rc_signal_lost_cmd; /**< true if RC lost mode is commanded */
|
||||||
bool rc_input_blocked; /**< set if RC input should be ignored */
|
bool rc_input_blocked; /**< set if RC input should be ignored */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user