aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphilipoe <philipp.oettershagen@mavt.ethz.ch>2014-10-20 16:25:38 +0200
committerphilipoe <philipp.oettershagen@mavt.ethz.ch>2014-10-20 16:43:11 +0200
commit4afa8645832c71ea1c35dc73d9424df80fac531a (patch)
treec42f48241adab977c79b459278bd4c7c79b95775
parent5c77fc0012eaaad5b92e1b31cedf8bf5b035b988 (diff)
downloadpx4-firmware-4afa8645832c71ea1c35dc73d9424df80fac531a.tar.gz
px4-firmware-4afa8645832c71ea1c35dc73d9424df80fac531a.tar.bz2
px4-firmware-4afa8645832c71ea1c35dc73d9424df80fac531a.zip
commander: Added duration of rc-loss to mavlink_log_critical message
-rw-r--r--src/modules/commander/commander.cpp3
-rw-r--r--src/modules/uORB/topics/vehicle_status.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp
index 23fdcb414..d8ebee4b6 100644
--- a/src/modules/commander/commander.cpp
+++ b/src/modules/commander/commander.cpp
@@ -1499,7 +1499,7 @@ int commander_thread_main(int argc, char *argv[])
} else {
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;
}
}
@@ -1594,6 +1594,7 @@ int commander_thread_main(int argc, char *argv[])
if (!status.rc_signal_lost) {
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_timestamp=sp_man.timestamp;
status_changed = true;
}
}
diff --git a/src/modules/uORB/topics/vehicle_status.h b/src/modules/uORB/topics/vehicle_status.h
index a1b2667e3..8d797e21a 100644
--- a/src/modules/uORB/topics/vehicle_status.h
+++ b/src/modules/uORB/topics/vehicle_status.h
@@ -201,6 +201,7 @@ struct vehicle_status_s {
bool rc_signal_found_once;
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_input_blocked; /**< set if RC input should be ignored */