From 343bdbaa7d3ac2fd6ee3d83c2d8bee5d80c94fda Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 10:49:36 +0200 Subject: accela: don't check NaNs in filter, wrong place --- ftnoir_filter_accela/ftnoir_filter_accela.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index 3e049eb0..ab5fda07 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -64,13 +64,9 @@ void FTNoIR_Filter::filter(const double* input, double *output) { for (int i = 0; i < 6; i++) { - const bool drop = std::isnan(input[i]) || std::isinf(input[i]); - double f = input[i]; - if (drop) - f = 0; - output[i] = f; - last_output[i] = f; - smoothed_input[i] = f; + output[i] = input[i]; + last_output[i] = input[i]; + smoothed_input[i] = input[i]; } first_run = false; t.start(); @@ -92,9 +88,7 @@ void FTNoIR_Filter::filter(const double* input, double *output) { Map& m = i >= 3 ? rot : trans; - const bool drop = std::isnan(input[i]) || std::isinf(input[i]); - const double f = drop ? last_output[i] : input[i]; - smoothed_input[i] = smoothed_input[i] * (1.-alpha) + f * alpha; + smoothed_input[i] = smoothed_input[i] * (1.-alpha) + input[i] * alpha; const double in = smoothed_input[i]; -- cgit v1.2.3