summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--filter-ewma2/ftnoir_filter_ewma2.h3
-rw-r--r--filter-kalman/kalman.h3
-rw-r--r--logic/tracker.cpp3
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();