From bfceb5dd3235c3afaf8563dea163796f2c2254ab Mon Sep 17 00:00:00 2001 From: fnoop Date: Wed, 8 Aug 2018 10:23:08 +0900 Subject: [PATCH] AC_PrecLand: Improve logging Add unit/multiplier of new fields to log structure Fix new log structure --- libraries/AC_PrecLand/AC_PrecLand.cpp | 6 ++++++ libraries/AC_PrecLand/AC_PrecLand.h | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/libraries/AC_PrecLand/AC_PrecLand.cpp b/libraries/AC_PrecLand/AC_PrecLand.cpp index 26a5483a15..1e71f1cb82 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.cpp +++ b/libraries/AC_PrecLand/AC_PrecLand.cpp @@ -199,6 +199,12 @@ bool AC_PrecLand::get_target_position_cm(Vector2f& ret) return true; } +void AC_PrecLand::get_target_position_measurement_cm(Vector3f& ret) +{ + ret = _target_pos_rel_meas_NED*100.0f; + return; +} + bool AC_PrecLand::get_target_position_relative_cm(Vector2f& ret) { if (!target_acquired()) { diff --git a/libraries/AC_PrecLand/AC_PrecLand.h b/libraries/AC_PrecLand/AC_PrecLand.h index c1c7ab001c..cc18bd20ee 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.h +++ b/libraries/AC_PrecLand/AC_PrecLand.h @@ -59,12 +59,24 @@ public: // returns time of last update uint32_t last_update_ms() const { return _last_update_ms; } + // returns time of last time target was seen + uint32_t last_backend_los_meas_ms() const { return _last_backend_los_meas_ms; } + + // returns estimator type + uint8_t estimator_type() const { return _estimator_type; } + + // returns ekf outlier count + uint32_t ekf_outlier_count() const { return _outlier_reject_count; } + // give chance to driver to get updates from sensor, should be called at 400hz void update(float rangefinder_alt_cm, bool rangefinder_alt_valid); // returns target position relative to the EKF origin bool get_target_position_cm(Vector2f& ret); + // returns target relative position as 3D vector + void get_target_position_measurement_cm(Vector3f& ret); + // returns target position relative to vehicle bool get_target_position_relative_cm(Vector2f& ret);