From 5f3a8456cdb53b9679086e3286716fff1e67b4a8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 9 Feb 2018 17:17:31 +0100 Subject: filter/accela: euthanize "smoothing" It only confuses users. Rename "sensitivity" to "smoothing". Update i18n source as per #743 --- filter-accela/accela-settings.hpp | 7 +- filter-accela/ftnoir_accela_filtercontrols.ui | 290 ++++++++++---------------- filter-accela/ftnoir_filter_accela.cpp | 20 +- filter-accela/ftnoir_filter_accela_dialog.cpp | 13 +- filter-accela/lang/nl_NL.ts | 44 ++-- filter-accela/lang/ru_RU.ts | 44 ++-- filter-accela/lang/stub.ts | 44 ++-- 7 files changed, 166 insertions(+), 296 deletions(-) diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp index 073a9f3f..2fea2f33 100644 --- a/filter-accela/accela-settings.hpp +++ b/filter-accela/accela-settings.hpp @@ -47,11 +47,10 @@ struct settings_accela : opts static void make_splines(spline& rot, spline& pos); - value rot_sensitivity { b, "rotation-sensitivity", slider_value(1.5, .05, 2.5) }, - pos_sensitivity { b, "translation-sensitivity", slider_value(1., .05, 1.5) }, + value rot_smoothing { b, "rotation-sensitivity", slider_value(1.5, .05, 2.5) }, + pos_smoothing { b, "translation-sensitivity", slider_value(1., .05, 1.5) }, rot_deadzone { b, "rotation-deadzone", slider_value(.03, 0, .2) }, - pos_deadzone { b, "translation-deadzone", slider_value(.1, 0, 1) }, - ewma { b, "ewma", slider_value(0, 0, 200) }; + pos_deadzone { b, "translation-deadzone", slider_value(.1, 0, 1) }; settings_accela() : opts("accela-sliders") {} }; diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui index dbb227ee..ce9f52a2 100644 --- a/filter-accela/ftnoir_accela_filtercontrols.ui +++ b/filter-accela/ftnoir_accela_filtercontrols.ui @@ -10,7 +10,7 @@ 0 0 550 - 345 + 275 @@ -36,70 +36,12 @@ 5 - - - - - 0 - 0 - - - - - 7 - - - - QFrame::NoFrame - - - <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html> - - - Qt::RichText - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - 0 - - - 0 - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - + + - Position filtering (X, Y, Z - translation) + Rotation filtering (Yaw, pitch, and roll) - + 4 @@ -113,7 +55,7 @@ 2 - + 0 @@ -121,12 +63,12 @@ - Sensitivity + Smoothing - + 50 @@ -134,12 +76,12 @@ - 0mm + - - + + 0 @@ -150,7 +92,7 @@ 0 - 20 + 49 1 @@ -158,10 +100,23 @@ Qt::Horizontal + + QSlider::TicksAbove + + + 50 + + + + + + + Deadzone + - + 50 @@ -169,19 +124,12 @@ - 0mm - - - - - - - Deadzone + - - + + 0 @@ -192,7 +140,7 @@ 0 - 29 + 20 1 @@ -200,29 +148,17 @@ Qt::Horizontal - - QSlider::TicksAbove - - - 40 - - trans_dz_slider - translation_slider - trans_dz - label_6 - trans_gain - label - + - Rotation filtering (Yaw, pitch, and roll) + Position filtering (X, Y, Z - translation) - + 4 @@ -236,7 +172,7 @@ 2 - + 0 @@ -244,12 +180,12 @@ - Sensitivity + Smoothing - + 50 @@ -257,12 +193,12 @@ - + 0mm - - + + 0 @@ -273,7 +209,7 @@ 0 - 49 + 20 1 @@ -281,23 +217,10 @@ Qt::Horizontal - - QSlider::TicksAbove - - - 50 - - - - - - - Deadzone - - + 50 @@ -305,69 +228,19 @@ - - - - - - - - - 0 - 0 - - - - 0 - - - 20 - - - 1 - - - Qt::Horizontal - - - - - - - - - - General - - - - 0 - - - 0 - - - - - Smoothing + 0mm - - - - - 50 - 0 - - + + - 0 ms + Deadzone - - + + 0 @@ -378,7 +251,7 @@ 0 - 20 + 29 1 @@ -390,17 +263,80 @@ QSlider::TicksAbove - 5 + 40 + trans_dz_slider + translation_slider + trans_dz + label_6 + trans_gain + label + + + + + + + 0 + 0 + + + + + 7 + + + + QFrame::NoFrame + + + <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html> + + + Qt::RichText + + + false + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 0 + + + 0 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + - ewma_slider rotation_slider rot_dz_slider translation_slider diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index edb2912f..aa031f2c 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -24,19 +24,17 @@ accela::accela() : first_run(true) template never_inline -static void do_deltas(const double* deltas, double* output, double alpha, double& smoothed, F&& fun) +static void do_deltas(const double* deltas, double* output, double& smoothed, F&& fun) { double norm[N]; - const double dist_ = progn( + const double dist = progn( double ret = 0; for (unsigned k = 0; k < N; k++) ret += deltas[k]*deltas[k]; return sqrt(ret); ); - const double dist = fmin(dist_, alpha*dist_ + (1-alpha)*smoothed); - smoothed = dist; const double value = double(fun(dist)); for (unsigned k = 0; k < N; k++) @@ -93,14 +91,12 @@ void accela::filter(const double* input, double *output) return; } - const double rot_thres = s.rot_sensitivity.to(); - const double pos_thres = s.pos_sensitivity.to(); + const double rot_thres = s.rot_smoothing.to(); + const double pos_thres = s.pos_smoothing.to(); const double dt = t.elapsed_seconds(); t.start(); - const double RC = s.ewma.to() / 1000.; // seconds - const double alpha = dt/(dt+RC); const double rot_dz = s.rot_deadzone.to(); const double pos_dz = s.pos_deadzone.to(); @@ -118,7 +114,9 @@ void accela::filter(const double* input, double *output) deltas[i] = d / rot_thres; } - do_deltas(&deltas[Yaw], &output[Yaw], alpha, smoothed_input[0], [this](double x) { return spline_rot.get_value_no_save(x); }); + do_deltas(&deltas[Yaw], &output[Yaw], smoothed_input[0], [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]) + fabs(smoothed_input[2])); @@ -151,7 +149,9 @@ void accela::filter(const double* input, double *output) deltas[i] = d / pos_thres; } - do_deltas(&deltas[TX], &output[TX], alpha, smoothed_input[1], [this](double x) { return spline_pos.get_value_no_save(x); }); + do_deltas(&deltas[TX], &output[TX], smoothed_input[1], [this](double x) { + return spline_pos.get_value_no_save(x); + }); // end diff --git a/filter-accela/ftnoir_filter_accela_dialog.cpp b/filter-accela/ftnoir_filter_accela_dialog.cpp index ab6634c4..51c31ca4 100644 --- a/filter-accela/ftnoir_filter_accela_dialog.cpp +++ b/filter-accela/ftnoir_filter_accela_dialog.cpp @@ -20,15 +20,13 @@ dialog_accela::dialog_accela() connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - tie_setting(s.rot_sensitivity, ui.rotation_slider); - tie_setting(s.pos_sensitivity, ui.translation_slider); - tie_setting(s.ewma, ui.ewma_slider); + tie_setting(s.rot_smoothing, ui.rotation_slider); + tie_setting(s.pos_smoothing, ui.translation_slider); tie_setting(s.rot_deadzone, ui.rot_dz_slider); tie_setting(s.pos_deadzone, ui.trans_dz_slider); - tie_setting(s.rot_sensitivity, ui.rot_gain, [](const slider_value& s) { return tr("%1°").arg(s, 0, 'g', 4); }); - tie_setting(s.pos_sensitivity, ui.trans_gain, [](const slider_value& s) { return tr("%1mm").arg(s, 0, 'g', 4); }); - tie_setting(s.ewma, ui.ewma_label, [](const slider_value& s) { return tr("%1ms").arg(s); }); + tie_setting(s.rot_smoothing, ui.rot_gain, [](const slider_value& s) { return tr("%1°").arg(s, 0, 'g', 4); }); + tie_setting(s.pos_smoothing, ui.trans_gain, [](const slider_value& s) { return tr("%1mm").arg(s, 0, 'g', 4); }); tie_setting(s.rot_deadzone, ui.rot_dz, [](const slider_value& s) { return tr("%1°").arg(s, 0, 'g', 4); }); tie_setting(s.pos_deadzone, ui.trans_dz, [](const slider_value& s) { return tr("%1mm").arg(s); }); @@ -78,6 +76,3 @@ void dialog_accela::save() { s.b->save(); } - - - diff --git a/filter-accela/lang/nl_NL.ts b/filter-accela/lang/nl_NL.ts index 6fb55c72..0f75d9fb 100644 --- a/filter-accela/lang/nl_NL.ts +++ b/filter-accela/lang/nl_NL.ts @@ -9,50 +9,35 @@ Filter-instellingen - - General - Algemeen - - - + + Smoothing Verzachten - - 0 ms - 0 ms - - - + Position filtering (X, Y, Z - translation) - + <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html> - - - Sensitivity - Gevoeligheid - - - + 0mm 0mm - - + + Deadzone Deadzone - + Rotation filtering (Yaw, pitch, and roll) @@ -66,21 +51,16 @@ dialog_accela - - + + %1° - - + + %1mm - - - %1ms - - diff --git a/filter-accela/lang/ru_RU.ts b/filter-accela/lang/ru_RU.ts index 6822ee27..3a2f2004 100644 --- a/filter-accela/lang/ru_RU.ts +++ b/filter-accela/lang/ru_RU.ts @@ -9,50 +9,35 @@ Настройка фильтра - - General - Основные настройки - - - + + Smoothing Сглаживание - - 0 ms - 0 мс - - - + Position filtering (X, Y, Z - translation) Фильтрация смещений (X, Y, Z) - + <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html> <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela-фильтр создан </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;">'ом<br/>Спасибо за помощь </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2016</span></p><p align="right"><br/><span style=" font-size:8pt;">Посетите </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">нашу вики</span></a><span style=" font-size:8pt;"> для понимания процесса настройки.</span></p></body></html> {10p?} {10p?} {0057a?} {10p?} {10p?} {0057a?} {10p?} {2012-2017<?} {8p?} {2.3"?} {8p?} {0000f?} {8p?} - - - Sensitivity - Чувствительность - - - + 0mm 0мм - - + + Deadzone Мертвая зона - + Rotation filtering (Yaw, pitch, and roll) Фильтрация поворотов (Рысканье, тангаж, крен) @@ -66,21 +51,16 @@ dialog_accela - - + + %1° - - + + %1mm - - - %1ms - - diff --git a/filter-accela/lang/stub.ts b/filter-accela/lang/stub.ts index 87e03816..aa45009a 100644 --- a/filter-accela/lang/stub.ts +++ b/filter-accela/lang/stub.ts @@ -9,50 +9,35 @@ - - General - - - - + + Smoothing - - 0 ms - - - - + Position filtering (X, Y, Z - translation) - + <html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html> - - - Sensitivity - - - - + 0mm - - + + Deadzone - + Rotation filtering (Yaw, pitch, and roll) @@ -66,21 +51,16 @@ dialog_accela - - + + %1° - - + + %1mm - - - %1ms - - -- cgit v1.2.3