diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-06 02:09:25 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-06 04:21:42 +0200 |
commit | e69e3c4fa5e5ba255537412d4b559e32ff8f1914 (patch) | |
tree | 3297d78eef31c74db4695dc3378c40c5bd9d2442 | |
parent | facfc0e2444e485d6e14b6b96462ef0acefb42c0 (diff) |
logic/tracker: call IFilter::center()
Issue: #540
-rw-r--r-- | filter-ewma2/ftnoir_filter_ewma2.h | 3 | ||||
-rw-r--r-- | filter-kalman/kalman.h | 3 | ||||
-rw-r--r-- | 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(); |