diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-24 13:47:09 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-24 13:47:09 +0200 |
commit | 948fb5ef0ffd6a83675763d80053a433e09aea06 (patch) | |
tree | 46909023bf581883605db2cad9007dcec35e5237 /ftnoir_filter_accela/ftnoir_filter_accela.cpp | |
parent | e55389fb2a43cd7cc2f1db95bc04a1d1eb789fa9 (diff) |
accela: try to smooth out the rotation function
Issue: #204
Diffstat (limited to 'ftnoir_filter_accela/ftnoir_filter_accela.cpp')
-rw-r--r-- | ftnoir_filter_accela/ftnoir_filter_accela.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index f8bd2ab1..cb5f1fa5 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -10,15 +10,13 @@ #include <QDebug> #include <QMutexLocker> #include "opentrack/plugin-api.hpp" -using namespace std; static constexpr double rot_gains[][2] = { { 2.66, 110 }, - { 2.33, 80 }, - { 2, 50 }, - { 1.66, 30 }, + { 2.0, 50 }, + { 1.66, 29 }, { 1.33, 15 }, - { 1, 5 }, + { 1, 6 }, { .66, 1.4 }, { .33, .4 }, { 0, 0 }, @@ -96,7 +94,7 @@ void FTNoIR_Filter::filter(const double* input, double *output) const double vec = in - last_output[i]; const double dz = i >= 3 ? rot_dz : trans_dz; - const double vec_ = max(0., fabs(vec) - dz); + const double vec_ = std::max(0., fabs(vec) - dz); const double thres = i >= 3 ? rot_t : trans_t; const double val = m.getValue(vec_ / thres); const double result = last_output[i] + (vec < 0 ? -1 : 1) * dt * val; |