summaryrefslogtreecommitdiffhomepage
path: root/filter-accela
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-05-27 05:37:59 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-05-27 05:38:09 +0200
commitcb3c5aa8c85a132556e63f1fe9218993aac24460 (patch)
treea7cdcc5ec9b222b57a89f115d7cc2b3addd715a6 /filter-accela
parent4472ef37e5725da8331fc0b2ca4f436cbe73fd76 (diff)
filter/accela: remove unused variable
Found-with: GCC 8 -Wall -Wextra
Diffstat (limited to 'filter-accela')
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp28
-rw-r--r--filter-accela/ftnoir_filter_accela.h1
2 files changed, 3 insertions, 26 deletions
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index 46b20fa7..6bab6a58 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -22,7 +22,7 @@ accela::accela() : first_run(true)
template<int N = 3, typename F>
never_inline
-static void do_deltas(const double* deltas, double* output, double& smoothed, F&& fun)
+static void do_deltas(const double* deltas, double* output, F&& fun)
{
double norm[N];
@@ -77,9 +77,6 @@ void accela::filter(const double* input, double *output)
last_output[i] = f;
}
- smoothed_input[0] = 0;
- smoothed_input[1] = 0;
-
t.start();
#if defined DEBUG_ACCELA
debug_max = 0;
@@ -112,29 +109,10 @@ void accela::filter(const double* input, double *output)
deltas[i] = d / rot_thres;
}
- do_deltas(&deltas[Yaw], &output[Yaw], smoothed_input[0], [this](double x) {
+ do_deltas(&deltas[Yaw], &output[Yaw], [this](double x) {
return spline_rot.get_value_no_save(x);
});
-#if defined DEBUG_ACCELA
- var.input(fabs(smoothed_input[0]) + fabs(smoothed_input[1]));
- debug_max = fmax(debug_max, smoothed_input[0]);
-
- using time_units::secs_;
-
- if (debug_timer.elapsed_seconds() >= 1)
- {
- debug_timer.start();
- qDebug() << "accela:"
- << "max" << debug_max
- << "mean" << var.avg()
- << "stddev/mean" << var.stddev() / var.avg();
-
- var.clear();
- debug_max = 0;
- }
-#endif
-
// pos
for (unsigned i = 0; i < 3; i++)
@@ -148,7 +126,7 @@ void accela::filter(const double* input, double *output)
deltas[i] = d / pos_thres;
}
- do_deltas(&deltas[TX], &output[TX], smoothed_input[1], [this](double x) {
+ do_deltas(&deltas[TX], &output[TX], [this](double x) {
return spline_pos.get_value_no_save(x);
});
diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h
index 8cf74ac1..40ba82ba 100644
--- a/filter-accela/ftnoir_filter_accela.h
+++ b/filter-accela/ftnoir_filter_accela.h
@@ -28,7 +28,6 @@ public:
private:
settings_accela s;
double last_output[6], deltas[6];
- double smoothed_input[2];
Timer t;
#if defined DEBUG_ACCELA
Timer debug_timer;