From c715228b8fe284d2dbdd0bbc20720d30614a5443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 7 Mar 2017 14:59:22 +0100 Subject: [PATCH] LandDetector: save & initialize total flight time --- src/modules/land_detector/LandDetector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/land_detector/LandDetector.cpp b/src/modules/land_detector/LandDetector.cpp index ddebf14ac8..9705ca4fb2 100644 --- a/src/modules/land_detector/LandDetector.cpp +++ b/src/modules/land_detector/LandDetector.cpp @@ -60,6 +60,8 @@ LandDetector::LandDetector() : _ground_contact_hysteresis(true), _taskShouldExit(false), _taskIsRunning(false), + _total_flight_time{0}, + _takeoff_time{0}, _work{} { // Use Trigger time when transitioning from in-air (false) to landed (true) / ground contact (true). @@ -150,6 +152,7 @@ void LandDetector::_cycle() param_set_no_notification(_p_total_flight_time_high, &flight_time); flight_time = _total_flight_time & 0xffffffff; param_set_no_notification(_p_total_flight_time_low, &flight_time); + param_save_default(); } _landDetected.timestamp = hrt_absolute_time();