summaryrefslogtreecommitdiffhomepage
path: root/filter-accela
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-01-16 06:02:14 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:49:13 +0100
commit1e04979c3452d4eac633677876a88f9411a1153d (patch)
tree99a126a9d2647fd25a8ef2adbab6bb84f2c97dfb /filter-accela
parent03d28dde1635e36508cff1f9eabc265cdb5febb9 (diff)
cruft only
Diffstat (limited to 'filter-accela')
-rw-r--r--filter-accela/accela-settings.hpp8
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp10
2 files changed, 9 insertions, 9 deletions
diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp
index ce27f800..c873b0b4 100644
--- a/filter-accela/accela-settings.hpp
+++ b/filter-accela/accela-settings.hpp
@@ -1,8 +1,8 @@
#pragma once
+#include "spline/spline.hpp"
#include "options/options.hpp"
using namespace options;
-#include "spline/spline.hpp"
// ------------------------------------
// debug knobs
@@ -19,8 +19,7 @@ struct settings_accela : opts
double x, y;
};
- static constexpr inline gains const rot_gains[16] =
- {
+ static constexpr gains const rot_gains[] {
{ 9, 300 },
{ 8, 200 },
{ 5, 100 },
@@ -30,8 +29,7 @@ struct settings_accela : opts
{ .5, .4 },
};
- static constexpr inline gains const pos_gains[16] =
- {
+ static constexpr gains const pos_gains[] {
{ 9, 200 },
{ 8, 150 },
{ 7, 110 },
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index 9e973586..3795a8f0 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -20,10 +20,12 @@ accela::accela()
s.make_splines(spline_rot, spline_pos);
}
-template<int N = 3, typename F>
+template<typename F>
cc_noinline
static void do_deltas(const double* deltas, double* output, F&& fun)
{
+ constexpr unsigned N = 3;
+
double norm[N];
double dist = 0;
@@ -40,17 +42,17 @@ static void do_deltas(const double* deltas, double* output, F&& fun)
}
double n = 0;
- for (unsigned k = 0; k < N; k++)
+ for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert)
n += norm[k];
if (n > 1e-6)
{
const double ret = 1./n;
- for (unsigned k = 0; k < N; k++)
+ for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert)
norm[k] *= ret;
}
else
- for (unsigned k = 0; k < N; k++)
+ for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert)
norm[k] = 0;
for (unsigned k = 0; k < N; k++)