summaryrefslogtreecommitdiffhomepage
path: root/filter-accela
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-20 05:37:37 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-20 05:37:37 +0200
commit1f6ca4d1ded3146f1e358007528d9f1ab2b522ec (patch)
tree5e66aba1ffbe27dbed383e6cbc498b5313504b11 /filter-accela
parent18b559ff13898e8e96275b7e329bfa23b7394f6f (diff)
some nonsense
Diffstat (limited to 'filter-accela')
-rw-r--r--filter-accela/accela-settings.hpp2
-rw-r--r--filter-accela/ftnoir_accela_filtercontrols.ui2
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp7
-rw-r--r--filter-accela/ftnoir_filter_accela.h2
4 files changed, 6 insertions, 7 deletions
diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp
index e1a48a6d..3f4c070a 100644
--- a/filter-accela/accela-settings.hpp
+++ b/filter-accela/accela-settings.hpp
@@ -45,7 +45,7 @@ struct settings_accela : opts
value<slider_value> rot_nonlinearity;
settings_accela() :
opts("accela-sliders"),
- rot_sensitivity(b, "rotation-sensitivity", slider_value(1.5, .2, 2.5)),
+ rot_sensitivity(b, "rotation-sensitivity", slider_value(1.5, .05, 2.5)),
pos_sensitivity(b, "translation-sensitivity", slider_value(1., .05, 1.5)),
rot_deadzone(b, "rotation-deadzone", slider_value(.03, 0, .1)),
pos_deadzone(b, "translation-deadzone", slider_value(.1, 0, 1)),
diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui
index 710431ac..913b775e 100644
--- a/filter-accela/ftnoir_accela_filtercontrols.ui
+++ b/filter-accela/ftnoir_accela_filtercontrols.ui
@@ -278,7 +278,7 @@
<number>0</number>
</property>
<property name="maximum">
- <number>46</number>
+ <number>49</number>
</property>
<property name="pageStep">
<number>1</number>
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index 5eac439a..a0c48ff1 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -6,7 +6,6 @@
*/
#include "ftnoir_filter_accela.h"
#include <algorithm>
-#include <cmath>
#include <QDebug>
#include <QMutexLocker>
#include "api/plugin-api.hpp"
@@ -122,7 +121,7 @@ void accela::filter(const double* input, double *output)
{
for (unsigned k = 3; k < 6; k++)
{
- static constexpr double nl_end = 5;
+ static constexpr double nl_end = 7;
if (fabs(deltas[k]) <= nl_end)
deltas[k] = copysign(pow(fabs(deltas[k]/nl_end), nl) * nl_end, deltas[k]);
@@ -132,7 +131,7 @@ void accela::filter(const double* input, double *output)
do_deltas(&deltas[Yaw], &output[Yaw], alpha, smoothed_input[0], [this](double x) { return spline_rot.get_value_no_save(x); });
#if defined DEBUG_ACCELA
- var.input(smoothed_input[0]);
+ var.input(fabs(smoothed_input[0]) + fabs(smoothed_input[1]) + fabs(smoothed_input[2]));
debug_max = fmax(debug_max, smoothed_input[0]);
using time_units::secs_;
@@ -142,7 +141,7 @@ void accela::filter(const double* input, double *output)
qDebug() << "accela:"
<< "max" << debug_max
<< "mean" << var.avg()
- << "stddev" << var.stddev();
+ << "stddev/mean" << var.stddev() / var.avg();
var.clear();
debug_max = 0;
diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h
index fa3c611f..9b0abec5 100644
--- a/filter-accela/ftnoir_filter_accela.h
+++ b/filter-accela/ftnoir_filter_accela.h
@@ -13,13 +13,13 @@
#include "compat/timer.hpp"
#include "compat/variance.hpp"
-#include <atomic>
#include <QMutex>
#include <QTimer>
// ------------------------------------
// debug knob
// ------------------------------------
+
//#define DEBUG_ACCELA
class accela : public IFilter