From e69e3c4fa5e5ba255537412d4b559e32ff8f1914 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Apr 2017 02:09:25 +0200 Subject: logic/tracker: call IFilter::center() Issue: #540 --- filter-ewma2/ftnoir_filter_ewma2.h | 3 ++- filter-kalman/kalman.h | 3 ++- logic/tracker.cpp | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/filter-ewma2/ftnoir_filter_ewma2.h b/filter-ewma2/ftnoir_filter_ewma2.h index e6a46739..8babc540 100644 --- a/filter-ewma2/ftnoir_filter_ewma2.h +++ b/filter-ewma2/ftnoir_filter_ewma2.h @@ -24,7 +24,8 @@ class ewma : public IFilter { public: ewma(); - void filter(const double *input, double *output); + void filter(const double *input, double *output) override; + void center() override { first_run = true; } private: // Deltas are smoothed over the last 1/60sec. const double delta_RC = 1./60; diff --git a/filter-kalman/kalman.h b/filter-kalman/kalman.h index a788cab9..607580dd 100644 --- a/filter-kalman/kalman.h +++ b/filter-kalman/kalman.h @@ -139,7 +139,8 @@ class kalman : public IFilter public: kalman(); void reset(); - void filter(const double *input, double *output); + void filter(const double *input, double *output) override; + void center() override { reset(); } PoseVector last_input; Timer timer; bool first_run; diff --git a/logic/tracker.cpp b/logic/tracker.cpp index ab526a86..4eba230c 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -195,6 +195,9 @@ void Tracker::logic() if (center_ordered) { + if (libs.pFilter) + libs.pFilter->center(); + if (own_center_logic) { scaled_rotation.rotation = scaled_rotation.camera.t(); -- cgit v1.2.3