From 3d6b9c0d3497eee46a57e0145e5552a68626fb0e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 02:25:50 +0200 Subject: cv/calibrator: return distinct sample count for all DOF --- cv/translation-calibrator.cpp | 9 ++++----- cv/translation-calibrator.hpp | 2 +- tracker-pt/ftnoir_tracker_pt_dialog.cpp | 25 ++++++++++++++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/cv/translation-calibrator.cpp b/cv/translation-calibrator.cpp index cdd573bc..fb150bf9 100644 --- a/cv/translation-calibrator.cpp +++ b/cv/translation-calibrator.cpp @@ -54,12 +54,10 @@ void TranslationCalibrator::update(const cv::Matx33d& R_CM_k, const cv::Vec3d& t y += H_k_T * t_CM_k; } -std::tuple TranslationCalibrator::get_estimate() +std::tuple TranslationCalibrator::get_estimate() { cv::Vec6f x = P.inv() * y; - qDebug() << "calibrator:" << nsamples << "samples total"; - unsigned values[3] {}; vec* in[] { &used_yaw_poses, &used_pitch_poses, &used_roll_poses }; @@ -71,12 +69,13 @@ std::tuple TranslationCalibrator::get_estimate() values[k]++; } - qDebug() << "samples" + qDebug() << "samples total" << nsamples << "yaw" << values[0] << "pitch" << values[1] << "roll" << values[2]; - return std::make_tuple(cv::Vec3f(-x[0], -x[1], -x[2]), nsamples); + return std::make_tuple(cv::Vec3f(-x[0], -x[1], -x[2]), + cv::Vec3i(values[0], values[1], values[2])); } bool TranslationCalibrator::check_bucket(const cv::Matx33d& R_CM_k) diff --git a/cv/translation-calibrator.hpp b/cv/translation-calibrator.hpp index ae2ed844..d908496a 100644 --- a/cv/translation-calibrator.hpp +++ b/cv/translation-calibrator.hpp @@ -29,7 +29,7 @@ public: void update(const cv::Matx33d& R_CM_k, const cv::Vec3d& t_CM_k); // get the current estimate for t_MH - std::tuple get_estimate(); + std::tuple get_estimate(); private: bool check_bucket(const cv::Matx33d& R_CM_k); diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index c2079c27..ee80fe6f 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -104,16 +104,31 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) qDebug() << "pt: stopping translation calibration"; { cv::Vec3f tmp; - unsigned nsamples; + cv::Vec3i nsamples; std::tie(tmp, nsamples) = trans_calib.get_estimate(); s.t_MH_x = int(tmp[0]); s.t_MH_y = int(tmp[1]); s.t_MH_z = int(tmp[2]); - static constexpr unsigned min_samples = 80; - const QString sample_feedback = nsamples >= min_samples - ? tr("%1 samples. Over %2, good!").arg(nsamples).arg(min_samples) - : tr("%1 samples. Try for at least %2 for a precise calibration.").arg(nsamples).arg(min_samples); + static constexpr unsigned min_yaw_samples = 15; + static constexpr unsigned min_pitch_samples = 15; + static constexpr unsigned min_samples = min_yaw_samples+min_pitch_samples; + + // Don't bother counting roll samples. Roll calibration is hard enough + // that it's a hidden unsupported feature anyway. + + const QString sample_feedback = progn( + if (nsamples[0] < min_yaw_samples) + return tr("%1 yaw samples. Yaw more to %2 samples for stable calibration.") + .arg(nsamples[0]).arg(min_yaw_samples); + if (nsamples[1] < min_pitch_samples) + return tr("%1 pitch samples. Pitch more to %2 samples for stable calibration.") + .arg(nsamples[1]).arg(min_pitch_samples); + + const unsigned nsamples_total = nsamples[0] + nsamples[1]; + + return tr("%1 samples. Over %2, good!").arg(nsamples_total).arg(min_samples); + ); ui.sample_count_display->setText(sample_feedback); } -- cgit v1.2.3 From 06d9c2b77ac30250e1abba11b2e2a40c4ed4803a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 02:26:16 +0200 Subject: proto/ft: include explicitly for `never_inline' etc --- proto-ft/ftnoir_protocol_ft.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 8e5996d8..9b5113a6 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -7,6 +7,7 @@ */ #include "compat/ndebug-guard.hpp" +#include "compat/util.hpp" #include "ftnoir_protocol_ft.h" #include "csv/csv.h" -- cgit v1.2.3 From 93cd5c5f2f6c23bae83c907b6381dca9492e9eff Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 16:57:28 +0200 Subject: options/value: try "extern template" for code size --- compat/linkage-macros.hpp | 3 +++ options/value.cpp | 3 +++ options/value.hpp | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 options/value.cpp diff --git a/compat/linkage-macros.hpp b/compat/linkage-macros.hpp index 460e7ee5..a4c4b351 100644 --- a/compat/linkage-macros.hpp +++ b/compat/linkage-macros.hpp @@ -7,3 +7,6 @@ # define OTR_GENERIC_EXPORT __attribute__ ((visibility ("default"))) # define OTR_GENERIC_IMPORT #endif + +#define OTR_TEMPLATE_EXPORT template class OTR_GENERIC_EXPORT +#define OTR_TEMPLATE_IMPORT extern template class OTR_GENERIC_IMPORT diff --git a/options/value.cpp b/options/value.cpp new file mode 100644 index 00000000..39bf0506 --- /dev/null +++ b/options/value.cpp @@ -0,0 +1,3 @@ +// instantiate the "template class" value symbols +#define OTR_OPT_VALUE_TMPL_EXPORT +#include "value.hpp" diff --git a/options/value.hpp b/options/value.hpp index ba482cf7..be3e4be2 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -130,4 +130,27 @@ private: const t def; }; +#if defined OTR_OPT_VALUE_TMPL_EXPORT && defined BUILD_OPTIONS +# define OTR_OPT_VALUE OTR_TEMPLATE_EXPORT +#else +# define OTR_OPT_VALUE OTR_TEMPLATE_IMPORT +#endif + +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; +OTR_OPT_VALUE value; + +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; +OTR_OPT_VALUE value>; + } // ns options -- cgit v1.2.3 From 367f981e6cace2beb3aad4f2173bcd0145f82ce8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 21:29:19 +0200 Subject: wtf --- python/lang/nl_NL.ts | 4 ---- python/lang/ru_RU.ts | 4 ---- python/lang/stub.ts | 4 ---- 3 files changed, 12 deletions(-) delete mode 100644 python/lang/nl_NL.ts delete mode 100644 python/lang/ru_RU.ts delete mode 100644 python/lang/stub.ts diff --git a/python/lang/nl_NL.ts b/python/lang/nl_NL.ts deleted file mode 100644 index 9e739505..00000000 --- a/python/lang/nl_NL.ts +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/python/lang/ru_RU.ts b/python/lang/ru_RU.ts deleted file mode 100644 index f62cf2e1..00000000 --- a/python/lang/ru_RU.ts +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/python/lang/stub.ts b/python/lang/stub.ts deleted file mode 100644 index 6401616d..00000000 --- a/python/lang/stub.ts +++ /dev/null @@ -1,4 +0,0 @@ - - - - -- cgit v1.2.3 From 5279f08e26ac9cea16f12f86c76b394c0d816b48 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 21:31:21 +0200 Subject: gui, logic: allow for binding Caps Lock and Tab Issue: #646 --- gui/keyboard.cpp | 1 - logic/win32-shortcuts.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index 1426300f..79c8fb29 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -39,7 +39,6 @@ void KeyboardListener::keyPressEvent(QKeyEvent* event) case Qt::Key_Meta: case Qt::Key_Alt: case Qt::Key_AltGr: - case Qt::Key_CapsLock: case Qt::Key_NumLock: break; case Qt::Key_Escape: diff --git a/logic/win32-shortcuts.cpp b/logic/win32-shortcuts.cpp index 114bb46d..ce733cd8 100644 --- a/logic/win32-shortcuts.cpp +++ b/logic/win32-shortcuts.cpp @@ -113,6 +113,7 @@ QList windows_key_sequences = win_key(DIK_X, Qt::Key::Key_X ), win_key(DIK_Y, Qt::Key::Key_Y ), win_key(DIK_Z, Qt::Key::Key_Z ), + win_key(DIK_TAB, Qt::Key::Key_Tab ), win_key(DIK_RETURN, Qt::Key::Key_Return), win_key(DIK_INSERT, Qt::Key::Key_Insert), win_key(DIK_DELETE, Qt::Key::Key_Delete), @@ -121,6 +122,7 @@ QList windows_key_sequences = win_key(DIK_SCROLL, Qt::Key::Key_ScrollLock), win_key(DIK_PAUSE, Qt::Key::Key_Pause), win_key(DIK_NUMLOCK, Qt::Key::Key_NumLock), + win_key(DIK_CAPSLOCK, Qt::Key::Key_CapsLock), #define mod(x, y) static_cast(x | y) win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)), win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)), -- cgit v1.2.3 From 03303311b3c8733238803d7d0b38ac1f58765338 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 21:37:54 +0200 Subject: logic/shortcuts: reformat etc --- dinput/keybinding-worker.cpp | 2 + logic/win32-shortcuts.cpp | 246 +++++++++++++++++++++---------------------- 2 files changed, 125 insertions(+), 123 deletions(-) diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index 41fa3486..042f01a5 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -142,6 +142,8 @@ void KeybindingWorker::run() case DIK_RCONTROL: case DIK_RSHIFT: case DIK_RALT: + case DIK_LWIN: + case DIK_RWIN: break; default: k.shift = !!((keystate[DIK_LSHIFT] & 0x80) || (keystate[DIK_RSHIFT] & 0x80)); diff --git a/logic/win32-shortcuts.cpp b/logic/win32-shortcuts.cpp index ce733cd8..af50b949 100644 --- a/logic/win32-shortcuts.cpp +++ b/logic/win32-shortcuts.cpp @@ -18,132 +18,132 @@ #include QList windows_key_mods = - QList({ - win_key(DIK_LCONTROL, Qt::Key::Key_Control), - win_key(DIK_RCONTROL, Qt::Key::Key_Control), - win_key(DIK_LALT, Qt::Key::Key_Alt), - win_key(DIK_RALT, Qt::Key::Key_Alt), - win_key(DIK_LSHIFT, Qt::Key::Key_Shift), - win_key(DIK_RSHIFT, Qt::Key::Key_Shift), - win_key(DIK_LWIN, Qt::Key::Key_unknown), - win_key(DIK_RWIN, Qt::Key::Key_unknown) - }); + QList{ + {DIK_LCONTROL, Qt::Key_Control}, + {DIK_RCONTROL, Qt::Key_Control}, + {DIK_LALT, Qt::Key_Alt}, + {DIK_RALT, Qt::Key_Alt}, + {DIK_LSHIFT, Qt::Key_Shift}, + {DIK_RSHIFT, Qt::Key_Shift}, + {DIK_LWIN, Qt::Key_Super_L}, + {DIK_RWIN, Qt::Key_Super_R}, + }; QList windows_key_sequences = - QList({ - win_key(DIK_F1, Qt::Key::Key_F1 ), - win_key(DIK_F2, Qt::Key::Key_F2 ), - win_key(DIK_F3, Qt::Key::Key_F3 ), - win_key(DIK_F4, Qt::Key::Key_F4 ), - win_key(DIK_F5, Qt::Key::Key_F5 ), - win_key(DIK_F6, Qt::Key::Key_F6 ), - win_key(DIK_F7, Qt::Key::Key_F7 ), - win_key(DIK_F8, Qt::Key::Key_F8 ), - win_key(DIK_F9, Qt::Key::Key_F9 ), - win_key(DIK_F10, Qt::Key::Key_F10 ), - win_key(DIK_F11, Qt::Key::Key_F11 ), - win_key(DIK_F12, Qt::Key::Key_F12 ), - win_key(DIK_LEFT, Qt::Key::Key_Left ), - win_key(DIK_RIGHT, Qt::Key::Key_Right ), - win_key(DIK_UP, Qt::Key::Key_Up ), - win_key(DIK_DOWN, Qt::Key::Key_Down ), - win_key(DIK_PRIOR, Qt::Key::Key_PageUp ), - win_key(DIK_NEXT, Qt::Key::Key_PageDown ), - win_key(DIK_HOME, Qt::Key::Key_Home ), - win_key(DIK_END, Qt::Key::Key_End ), - win_key(DIK_BACK, Qt::Key::Key_Backspace ), - win_key(DIK_COMMA, Qt::Key::Key_Comma ), - win_key(DIK_PERIOD, Qt::Key::Key_Period ), - win_key(DIK_LBRACKET, Qt::Key::Key_BracketLeft ), - win_key(DIK_RBRACKET, Qt::Key::Key_BracketRight ), - win_key(DIK_SEMICOLON, Qt::Key::Key_Semicolon ), - win_key(DIK_SLASH, Qt::Key::Key_Slash ), - win_key(DIK_BACKSLASH, Qt::Key::Key_Backslash ), - win_key(DIK_BACKSPACE, Qt::Key::Key_Backspace ), - win_key(DIK_APOSTROPHE, Qt::Key::Key_Apostrophe ), - win_key(DIK_GRAVE, Qt::Key::Key_QuoteLeft ), - win_key(DIK_MINUS, Qt::Key::Key_Minus ), - win_key(DIK_EQUALS, Qt::Key::Key_Equal ), - win_key(DIK_PERIOD, Qt::Key::Key_Period ), - win_key(DIK_F1, Qt::Key::Key_F1 ), - win_key(DIK_F2, Qt::Key::Key_F2 ), - win_key(DIK_F3, Qt::Key::Key_F3 ), - win_key(DIK_F4, Qt::Key::Key_F4 ), - win_key(DIK_F5, Qt::Key::Key_F5 ), - win_key(DIK_F6, Qt::Key::Key_F6 ), - win_key(DIK_F7, Qt::Key::Key_F7 ), - win_key(DIK_F8, Qt::Key::Key_F8 ), - win_key(DIK_F9, Qt::Key::Key_F9 ), - win_key(DIK_F10, Qt::Key::Key_F10 ), - win_key(DIK_F11, Qt::Key::Key_F11 ), - win_key(DIK_F12, Qt::Key::Key_F12 ), - win_key(DIK_0, Qt::Key::Key_0 ), - win_key(DIK_1, Qt::Key::Key_1 ), - win_key(DIK_2, Qt::Key::Key_2 ), - win_key(DIK_3, Qt::Key::Key_3 ), - win_key(DIK_4, Qt::Key::Key_4 ), - win_key(DIK_5, Qt::Key::Key_5 ), - win_key(DIK_6, Qt::Key::Key_6 ), - win_key(DIK_7, Qt::Key::Key_7 ), - win_key(DIK_8, Qt::Key::Key_8 ), - win_key(DIK_9, Qt::Key::Key_9 ), - win_key(DIK_A, Qt::Key::Key_A ), - win_key(DIK_B, Qt::Key::Key_B ), - win_key(DIK_C, Qt::Key::Key_C ), - win_key(DIK_D, Qt::Key::Key_D ), - win_key(DIK_E, Qt::Key::Key_E ), - win_key(DIK_F, Qt::Key::Key_F ), - win_key(DIK_G, Qt::Key::Key_G ), - win_key(DIK_H, Qt::Key::Key_H ), - win_key(DIK_I, Qt::Key::Key_I ), - win_key(DIK_J, Qt::Key::Key_J ), - win_key(DIK_K, Qt::Key::Key_K ), - win_key(DIK_L, Qt::Key::Key_L ), - win_key(DIK_M, Qt::Key::Key_M ), - win_key(DIK_N, Qt::Key::Key_N ), - win_key(DIK_O, Qt::Key::Key_O ), - win_key(DIK_P, Qt::Key::Key_P ), - win_key(DIK_Q, Qt::Key::Key_Q ), - win_key(DIK_R, Qt::Key::Key_R ), - win_key(DIK_S, Qt::Key::Key_S ), - win_key(DIK_T, Qt::Key::Key_T ), - win_key(DIK_U, Qt::Key::Key_U ), - win_key(DIK_V, Qt::Key::Key_V ), - win_key(DIK_W, Qt::Key::Key_W ), - win_key(DIK_X, Qt::Key::Key_X ), - win_key(DIK_Y, Qt::Key::Key_Y ), - win_key(DIK_Z, Qt::Key::Key_Z ), - win_key(DIK_TAB, Qt::Key::Key_Tab ), - win_key(DIK_RETURN, Qt::Key::Key_Return), - win_key(DIK_INSERT, Qt::Key::Key_Insert), - win_key(DIK_DELETE, Qt::Key::Key_Delete), - win_key(DIK_SPACE, Qt::Key::Key_Space), - win_key(DIK_SYSRQ, Qt::Key::Key_Print), - win_key(DIK_SCROLL, Qt::Key::Key_ScrollLock), - win_key(DIK_PAUSE, Qt::Key::Key_Pause), - win_key(DIK_NUMLOCK, Qt::Key::Key_NumLock), - win_key(DIK_CAPSLOCK, Qt::Key::Key_CapsLock), + QList{ + {DIK_F1, Qt::Key_F1 }, + {DIK_F2, Qt::Key_F2 }, + {DIK_F3, Qt::Key_F3 }, + {DIK_F4, Qt::Key_F4 }, + {DIK_F5, Qt::Key_F5 }, + {DIK_F6, Qt::Key_F6 }, + {DIK_F7, Qt::Key_F7 }, + {DIK_F8, Qt::Key_F8 }, + {DIK_F9, Qt::Key_F9 }, + {DIK_F10, Qt::Key_F10 }, + {DIK_F11, Qt::Key_F11 }, + {DIK_F12, Qt::Key_F12 }, + {DIK_LEFT, Qt::Key_Left }, + {DIK_RIGHT, Qt::Key_Right }, + {DIK_UP, Qt::Key_Up }, + {DIK_DOWN, Qt::Key_Down }, + {DIK_PRIOR, Qt::Key_PageUp }, + {DIK_NEXT, Qt::Key_PageDown }, + {DIK_HOME, Qt::Key_Home }, + {DIK_END, Qt::Key_End }, + {DIK_BACK, Qt::Key_Backspace }, + {DIK_COMMA, Qt::Key_Comma }, + {DIK_PERIOD, Qt::Key_Period }, + {DIK_LBRACKET, Qt::Key_BracketLeft }, + {DIK_RBRACKET, Qt::Key_BracketRight }, + {DIK_SEMICOLON, Qt::Key_Semicolon }, + {DIK_SLASH, Qt::Key_Slash }, + {DIK_BACKSLASH, Qt::Key_Backslash }, + {DIK_BACKSPACE, Qt::Key_Backspace }, + {DIK_APOSTROPHE, Qt::Key_Apostrophe }, + {DIK_GRAVE, Qt::Key_QuoteLeft }, + {DIK_MINUS, Qt::Key_Minus }, + {DIK_EQUALS, Qt::Key_Equal }, + {DIK_PERIOD, Qt::Key_Period }, + {DIK_F1, Qt::Key_F1 }, + {DIK_F2, Qt::Key_F2 }, + {DIK_F3, Qt::Key_F3 }, + {DIK_F4, Qt::Key_F4 }, + {DIK_F5, Qt::Key_F5 }, + {DIK_F6, Qt::Key_F6 }, + {DIK_F7, Qt::Key_F7 }, + {DIK_F8, Qt::Key_F8 }, + {DIK_F9, Qt::Key_F9 }, + {DIK_F10, Qt::Key_F10 }, + {DIK_F11, Qt::Key_F11 }, + {DIK_F12, Qt::Key_F12 }, + {DIK_0, Qt::Key_0 }, + {DIK_1, Qt::Key_1 }, + {DIK_2, Qt::Key_2 }, + {DIK_3, Qt::Key_3 }, + {DIK_4, Qt::Key_4 }, + {DIK_5, Qt::Key_5 }, + {DIK_6, Qt::Key_6 }, + {DIK_7, Qt::Key_7 }, + {DIK_8, Qt::Key_8 }, + {DIK_9, Qt::Key_9 }, + {DIK_A, Qt::Key_A }, + {DIK_B, Qt::Key_B }, + {DIK_C, Qt::Key_C }, + {DIK_D, Qt::Key_D }, + {DIK_E, Qt::Key_E }, + {DIK_F, Qt::Key_F }, + {DIK_G, Qt::Key_G }, + {DIK_H, Qt::Key_H }, + {DIK_I, Qt::Key_I }, + {DIK_J, Qt::Key_J }, + {DIK_K, Qt::Key_K }, + {DIK_L, Qt::Key_L }, + {DIK_M, Qt::Key_M }, + {DIK_N, Qt::Key_N }, + {DIK_O, Qt::Key_O }, + {DIK_P, Qt::Key_P }, + {DIK_Q, Qt::Key_Q }, + {DIK_R, Qt::Key_R }, + {DIK_S, Qt::Key_S }, + {DIK_T, Qt::Key_T }, + {DIK_U, Qt::Key_U }, + {DIK_V, Qt::Key_V }, + {DIK_W, Qt::Key_W }, + {DIK_X, Qt::Key_X }, + {DIK_Y, Qt::Key_Y }, + {DIK_Z, Qt::Key_Z }, + {DIK_TAB, Qt::Key_Tab }, + {DIK_RETURN, Qt::Key_Return}, + {DIK_INSERT, Qt::Key_Insert}, + {DIK_DELETE, Qt::Key_Delete}, + {DIK_SPACE, Qt::Key_Space}, + {DIK_SYSRQ, Qt::Key_Print}, + {DIK_SCROLL, Qt::Key_ScrollLock}, + {DIK_PAUSE, Qt::Key_Pause}, + {DIK_NUMLOCK, Qt::Key_NumLock}, + {DIK_CAPSLOCK, Qt::Key_CapsLock}, #define mod(x, y) static_cast(x | y) - win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)), - win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)), - win_key(DIK_NUMPAD1, mod(Qt::Key::Key_1, Qt::KeypadModifier)), - win_key(DIK_NUMPAD2, mod(Qt::Key::Key_2, Qt::KeypadModifier)), - win_key(DIK_NUMPAD3, mod(Qt::Key::Key_3, Qt::KeypadModifier)), - win_key(DIK_NUMPAD4, mod(Qt::Key::Key_4, Qt::KeypadModifier)), - win_key(DIK_NUMPAD5, mod(Qt::Key::Key_5, Qt::KeypadModifier)), - win_key(DIK_NUMPAD6, mod(Qt::Key::Key_6, Qt::KeypadModifier)), - win_key(DIK_NUMPAD7, mod(Qt::Key::Key_7, Qt::KeypadModifier)), - win_key(DIK_NUMPAD8, mod(Qt::Key::Key_8, Qt::KeypadModifier)), - win_key(DIK_NUMPAD9, mod(Qt::Key::Key_9, Qt::KeypadModifier)), - win_key(DIK_NUMPADCOMMA, mod(Qt::Key::Key_Comma, Qt::KeypadModifier)), - win_key(DIK_NUMPADENTER, mod(Qt::Key::Key_Enter, Qt::KeypadModifier)), - win_key(DIK_NUMPADEQUALS, mod(Qt::Key::Key_Equal, Qt::KeypadModifier)), - win_key(DIK_NUMPADMINUS, mod(Qt::Key::Key_Minus, Qt::KeypadModifier)), - win_key(DIK_NUMPADPERIOD, mod(Qt::Key::Key_Period, Qt::KeypadModifier)), - win_key(DIK_NUMPADPLUS, mod(Qt::Key::Key_Plus, Qt::KeypadModifier)), - win_key(DIK_NUMPADSLASH, mod(Qt::Key::Key_Slash, Qt::KeypadModifier)), - win_key(DIK_NUMPADSTAR, mod(Qt::Key::Key_multiply, Qt::KeypadModifier)), - }); + {DIK_NUMPAD0, mod(Qt::Key_0, Qt::KeypadModifier)}, + {DIK_NUMPAD0, mod(Qt::Key_0, Qt::KeypadModifier)}, + {DIK_NUMPAD1, mod(Qt::Key_1, Qt::KeypadModifier)}, + {DIK_NUMPAD2, mod(Qt::Key_2, Qt::KeypadModifier)}, + {DIK_NUMPAD3, mod(Qt::Key_3, Qt::KeypadModifier)}, + {DIK_NUMPAD4, mod(Qt::Key_4, Qt::KeypadModifier)}, + {DIK_NUMPAD5, mod(Qt::Key_5, Qt::KeypadModifier)}, + {DIK_NUMPAD6, mod(Qt::Key_6, Qt::KeypadModifier)}, + {DIK_NUMPAD7, mod(Qt::Key_7, Qt::KeypadModifier)}, + {DIK_NUMPAD8, mod(Qt::Key_8, Qt::KeypadModifier)}, + {DIK_NUMPAD9, mod(Qt::Key_9, Qt::KeypadModifier)}, + {DIK_NUMPADCOMMA, mod(Qt::Key_Comma, Qt::KeypadModifier)}, + {DIK_NUMPADENTER, mod(Qt::Key_Enter, Qt::KeypadModifier)}, + {DIK_NUMPADEQUALS, mod(Qt::Key_Equal, Qt::KeypadModifier)}, + {DIK_NUMPADMINUS, mod(Qt::Key_Minus, Qt::KeypadModifier)}, + {DIK_NUMPADPERIOD, mod(Qt::Key_Period, Qt::KeypadModifier)}, + {DIK_NUMPADPLUS, mod(Qt::Key_Plus, Qt::KeypadModifier)}, + {DIK_NUMPADSLASH, mod(Qt::Key_Slash, Qt::KeypadModifier)}, + {DIK_NUMPADSTAR, mod(Qt::Key_multiply, Qt::KeypadModifier)}, + }; bool win_key::to_qt(const Key& k, QKeySequence& qt_, Qt::KeyboardModifiers &mods) { -- cgit v1.2.3 From 57e2aa0356b21b40c9fc5c53edc8bfaebd95a60e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 22:23:56 +0200 Subject: proto/simconnect: add version list for reference Our manifests are out of what. This'll help. Provided-by: @ronh991 in --- proto-simconnect/simconnect versions.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 proto-simconnect/simconnect versions.txt diff --git a/proto-simconnect/simconnect versions.txt b/proto-simconnect/simconnect versions.txt new file mode 100644 index 00000000..dde71f8f --- /dev/null +++ b/proto-simconnect/simconnect versions.txt @@ -0,0 +1,20 @@ +#define LVERS_ORIG "10.0.60905.0" +#define LVERS_SP1B1 "10.0.61232.0" +#define LVERS_SP1B2 "10.0.61233.0" +#define LVERS_SP1B3 "10.0.61234.0" +#define LVERS_SP1B4 "10.0.61240.0" +#define LVERS_SP1 "10.0.61242.0" +#define LVERS_ACCA1 "10.0.61245.0" +#define LVERS_ACCB1 "10.0.61246.0" +#define LVERS_ACCB2 "10.0.61247.0" +#define LVERS_ACCB3 "10.0.61248.0" +#define LVERS_ACCSP2 "10.0.61259.0" +#define LVERS_STEAM "10.0.62607.0" +#define LVERS_STEAM2 "10.0.62608.0" +#define LVERS_STEAM3 "10.0.62609.0" +#define LVERS_STEAM4 "10.0.62610.0" +#define LVERS_STEAM5 "10.0.62611.0" +#define LVERS_STEAM6 "10.0.62612.0" +#define LVERS_STEAM7 "10.0.62613.0" +#define LVERS_STEAM8 "10.0.62614.0" +#define LVERS_STEAM9 "10.0.62615.0" -- cgit v1.2.3 From fa8e4da6148fa00e77fc3a4be55769d40a1db057 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 03:13:45 +0200 Subject: proto/simconnect: fix WinSxS library versions We had all the wrong versions assigned to comboboxen. With the correct versions, Prepar3D works with its own SimConnect redist named "SP2-XPACK". The library version is the same as SP2 and the combobox item exists only to help users. --- compat/math-imports.hpp | 45 +++++++++++++++++ proto-simconnect/fsx_p3d_sp2_xpack.manifest | 8 +++ proto-simconnect/fsx_rtm.manifest | 8 +++ proto-simconnect/fsx_sp1.manifest | 8 +++ proto-simconnect/fsx_sp2.manifest | 8 +++ proto-simconnect/fsx_steam_last.manifest | 8 +++ proto-simconnect/fsx_steam_orig.manifest | 8 +++ proto-simconnect/ftnoir-protocol-sc.rc | 9 ++-- proto-simconnect/ftnoir_protocol_sc.cpp | 66 ++++++++++++------------- proto-simconnect/ftnoir_protocol_sc.h | 4 +- proto-simconnect/ftnoir_sccontrols.ui | 19 ++++++- proto-simconnect/manifest-template.in | 8 +++ proto-simconnect/scserver.manifest | 13 ----- proto-simconnect/scserver_acceleration.manifest | 13 ----- proto-simconnect/scserver_sp2.manifest | 13 ----- 15 files changed, 159 insertions(+), 79 deletions(-) create mode 100644 compat/math-imports.hpp create mode 100644 proto-simconnect/fsx_p3d_sp2_xpack.manifest create mode 100644 proto-simconnect/fsx_rtm.manifest create mode 100644 proto-simconnect/fsx_sp1.manifest create mode 100644 proto-simconnect/fsx_sp2.manifest create mode 100644 proto-simconnect/fsx_steam_last.manifest create mode 100644 proto-simconnect/fsx_steam_orig.manifest create mode 100644 proto-simconnect/manifest-template.in delete mode 100644 proto-simconnect/scserver.manifest delete mode 100644 proto-simconnect/scserver_acceleration.manifest delete mode 100644 proto-simconnect/scserver_sp2.manifest diff --git a/compat/math-imports.hpp b/compat/math-imports.hpp new file mode 100644 index 00000000..ad70f361 --- /dev/null +++ b/compat/math-imports.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include +#include + +namespace otr_math +{ + +using std::copysign; + +using std::sqrt; +using std::pow; + +using std::fabs; +using std::fmin; +using std::fmax; + +using std::atan; +using std::atan2; +using std::asin; +using std::acos; + +using std::sin; +using std::cos; +using std::tan; + +using std::round; +using std::fmod; + +using std::uintptr_t; +using std::intptr_t; + +using std::int64_t; +using std::int32_t; + +using std::uint64_t; +using std::uint32_t; + +template +static inline constexpr auto signum(T x) +{ + return (T() < x) - (x < T()); +} + +} // ns otr_math diff --git a/proto-simconnect/fsx_p3d_sp2_xpack.manifest b/proto-simconnect/fsx_p3d_sp2_xpack.manifest new file mode 100644 index 00000000..25a62765 --- /dev/null +++ b/proto-simconnect/fsx_p3d_sp2_xpack.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/fsx_rtm.manifest b/proto-simconnect/fsx_rtm.manifest new file mode 100644 index 00000000..760de973 --- /dev/null +++ b/proto-simconnect/fsx_rtm.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/fsx_sp1.manifest b/proto-simconnect/fsx_sp1.manifest new file mode 100644 index 00000000..ee746740 --- /dev/null +++ b/proto-simconnect/fsx_sp1.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/fsx_sp2.manifest b/proto-simconnect/fsx_sp2.manifest new file mode 100644 index 00000000..25a62765 --- /dev/null +++ b/proto-simconnect/fsx_sp2.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/fsx_steam_last.manifest b/proto-simconnect/fsx_steam_last.manifest new file mode 100644 index 00000000..b8cbaca4 --- /dev/null +++ b/proto-simconnect/fsx_steam_last.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/fsx_steam_orig.manifest b/proto-simconnect/fsx_steam_orig.manifest new file mode 100644 index 00000000..f1b3314c --- /dev/null +++ b/proto-simconnect/fsx_steam_orig.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/ftnoir-protocol-sc.rc b/proto-simconnect/ftnoir-protocol-sc.rc index c89eb9a7..5f47a5c9 100644 --- a/proto-simconnect/ftnoir-protocol-sc.rc +++ b/proto-simconnect/ftnoir-protocol-sc.rc @@ -1,4 +1,7 @@ #include -142 RT_MANIFEST scserver.manifest -143 RT_MANIFEST scserver_sp2.manifest -144 RT_MANIFEST scserver_acceleration.manifest \ No newline at end of file +142 RT_MANIFEST fsx_rtm.manifest +143 RT_MANIFEST fsx_sp1.manifest +144 RT_MANIFEST fsx_sp2.manifest +145 RT_MANIFEST fsx_p3d_sp2_xpack.manifest +146 RT_MANIFEST fsx_steam_orig.manifest +147 RT_MANIFEST fsx_steam_last.manifest diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp index be0c23c4..cfe973a7 100644 --- a/proto-simconnect/ftnoir_protocol_sc.cpp +++ b/proto-simconnect/ftnoir_protocol_sc.cpp @@ -26,7 +26,7 @@ simconnect::~simconnect() void simconnect::run() { - HANDLE event = CreateEvent(NULL, FALSE, FALSE, nullptr); + HANDLE event = CreateEventA(NULL, FALSE, FALSE, nullptr); if (event == nullptr) { @@ -38,60 +38,57 @@ void simconnect::run() { HRESULT hr; - qDebug() << "simconnect: starting"; - if (SUCCEEDED(hr = simconnect_open(&hSimConnect, "opentrack", nullptr, 0, event, 0))) { if (!SUCCEEDED(hr = simconnect_subscribetosystemevent(hSimConnect, 0, "Frame"))) { qDebug() << "simconnect: can't subscribe to frame event:" << hr; - - should_reconnect = true; // will free simconnect handle and continue the loop } Timer tm; - int idle_seconds = 0; + should_reconnect = false; - while (!isInterruptionRequested()) - { - if (should_reconnect) + if (SUCCEEDED(hr)) + while (!isInterruptionRequested()) { - should_reconnect = false; - break; - } - - if (WaitForSingleObject(event, 10) == WAIT_OBJECT_0) - { - tm.start(); - idle_seconds = 0; + if (should_reconnect) + break; - if (!SUCCEEDED(hr = simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast(this)))) + if (WaitForSingleObject(event, 100) == WAIT_OBJECT_0) { - qDebug() << "simconnect: calldispatch failed:" << hr; - break; + tm.start(); + + if (!SUCCEEDED(hr = simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast(this)))) + { + qDebug() << "simconnect: calldispatch failed:" << hr; + break; + } } - } - else - { - if (int(tm.elapsed_seconds()) > idle_seconds) + else { - idle_seconds++; - qDebug() << "simconnect: can't process event for" << int(tm.elapsed_seconds()) << "seconds"; + const int idle_seconds = tm.elapsed_seconds(); + + static constexpr int max_idle_seconds = 2; + + if (idle_seconds >= max_idle_seconds) + { + qDebug() << "simconnect: reconnect"; + break; + } } } - } (void) simconnect_close(hSimConnect); } else - { qDebug() << "simconnect: can't open handle:" << hr; - } if (!isInterruptionRequested()) - Sleep(100); + Sleep(3000); } + qDebug() << "simconnect: exit"; + CloseHandle(event); } @@ -120,8 +117,8 @@ public: { hactctx = INVALID_HANDLE_VALUE; actctx_cookie = 0; - ACTCTXA actx = {0}; - actx.cbSize = sizeof(ACTCTXA); + ACTCTXA actx = {}; + actx.cbSize = sizeof(actx); actx.lpResourceName = MAKEINTRESOURCEA(resid); actx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID; #ifdef _MSC_VER @@ -229,9 +226,12 @@ void CALLBACK simconnect::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWO default: break; case SIMCONNECT_RECV_ID_EXCEPTION: + qDebug() << "simconnect: got exception"; + //self.should_reconnect = true; + break; case SIMCONNECT_RECV_ID_QUIT: + qDebug() << "simconnect: got quit event"; self.should_reconnect = true; - qDebug() << "simconnect: received ID_QUIT event"; break; case SIMCONNECT_RECV_ID_EVENT_FRAME: self.handle(); diff --git a/proto-simconnect/ftnoir_protocol_sc.h b/proto-simconnect/ftnoir_protocol_sc.h index 93376885..151dd741 100644 --- a/proto-simconnect/ftnoir_protocol_sc.h +++ b/proto-simconnect/ftnoir_protocol_sc.h @@ -3,7 +3,7 @@ * ISC License (ISC) * * * * Copyright (c) 2015, Wim Vriend * - * Copyright (c) 2014, Stanislaw Halik * + * Copyright (c) 2014, 2017 Stanislaw Halik * * * * Permission to use, copy, modify, and/or distribute this software for any * * purpose with or without fee is hereby granted, provided that the above * @@ -30,7 +30,7 @@ struct settings : opts { value sxs_manifest; settings() : opts("proto-simconnect"), - sxs_manifest(b, "sxs-manifest-version", 0) + sxs_manifest(b, "simconnect-manifest", 2) {} }; diff --git a/proto-simconnect/ftnoir_sccontrols.ui b/proto-simconnect/ftnoir_sccontrols.ui index 887d6d80..7a607096 100644 --- a/proto-simconnect/ftnoir_sccontrols.ui +++ b/proto-simconnect/ftnoir_sccontrols.ui @@ -51,6 +51,11 @@ 0 + + + RTM + + SP1 @@ -58,12 +63,22 @@ - SP2 + SP2 -- Acceleration + + + + + Prepar3d SP2 XPACK + + + + + Steam FSX (older) - Acceleration + Steam FSX (new) diff --git a/proto-simconnect/manifest-template.in b/proto-simconnect/manifest-template.in new file mode 100644 index 00000000..fdf2c74a --- /dev/null +++ b/proto-simconnect/manifest-template.in @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/proto-simconnect/scserver.manifest b/proto-simconnect/scserver.manifest deleted file mode 100644 index d342cfda..00000000 --- a/proto-simconnect/scserver.manifest +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/proto-simconnect/scserver_acceleration.manifest b/proto-simconnect/scserver_acceleration.manifest deleted file mode 100644 index 06459587..00000000 --- a/proto-simconnect/scserver_acceleration.manifest +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/proto-simconnect/scserver_sp2.manifest b/proto-simconnect/scserver_sp2.manifest deleted file mode 100644 index 3020d16c..00000000 --- a/proto-simconnect/scserver_sp2.manifest +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - -- cgit v1.2.3 From cba24a90995bcc6364040e2da568f6f5f5565e58 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 11:06:04 +0200 Subject: filter/accela: add debug knob --- filter-accela/ftnoir_filter_accela.cpp | 47 ++++++++++++++++++++++++---------- filter-accela/ftnoir_filter_accela.h | 15 +++++++++-- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index a4095774..92b9e197 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -11,11 +11,9 @@ #include #include "api/plugin-api.hpp" -using std::fabs; -using std::sqrt; -using std::pow; -using std::copysign; -using std::fmin; +#include "compat/math-imports.hpp" + +using namespace otr_math; constexpr settings_accela::gains settings_accela::rot_gains[16]; constexpr settings_accela::gains settings_accela::pos_gains[16]; @@ -25,12 +23,6 @@ accela::accela() : first_run(true) s.make_splines(spline_rot, spline_pos); } -template -static inline constexpr T signum(T x) -{ - return T((T(0) < x) - (x < T(0))); -} - template never_inline static void do_deltas(const double* deltas, double* output, double alpha, double& smoothed, F&& fun) @@ -44,7 +36,8 @@ static void do_deltas(const double* deltas, double* output, double alpha, double return sqrt(ret); ); - const double dist = smoothed = fmin(dist_, alpha*dist_ + (1-alpha)*smoothed); + 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++) @@ -78,18 +71,26 @@ static void do_deltas(const double* deltas, double* output, double alpha, double void accela::filter(const double* input, double *output) { - if (first_run) + if (unlikely(first_run)) { + first_run = false; + for (int i = 0; i < 6; i++) { const double f = input[i]; output[i] = f; last_output[i] = f; } - first_run = false; + smoothed_input[0] = 0; smoothed_input[1] = 0; + t.start(); +#if defined DEBUG_ACCELA + debug_max = 0; + debug_timer.start(); +#endif + return; } @@ -132,6 +133,24 @@ 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]); + debug_max = fmax(debug_max, smoothed_input[0]); + + using time_units::secs_; + + if (debug_timer.is_elapsed(secs_(1))) + { + qDebug() << "accela:" + << "max" << debug_max + << "mean" << var.avg() + << "stddev" << var.stddev(); + + var.clear(); + debug_max = 0; + } +#endif + // pos for (unsigned i = 0; i < 3; i++) diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h index bbe74b08..fa3c611f 100644 --- a/filter-accela/ftnoir_filter_accela.h +++ b/filter-accela/ftnoir_filter_accela.h @@ -11,11 +11,17 @@ #include "accela-settings.hpp" #include "api/plugin-api.hpp" #include "compat/timer.hpp" +#include "compat/variance.hpp" #include #include #include +// ------------------------------------ +// debug knob +// ------------------------------------ +//#define DEBUG_ACCELA + class accela : public IFilter { public: @@ -25,13 +31,18 @@ public: spline spline_rot, spline_pos; private: settings_accela s; - bool first_run; double last_output[6], deltas[6]; double smoothed_input[2]; Timer t; +#if defined DEBUG_ACCELA + Timer debug_timer; + double debug_max; + variance var; +#endif + bool first_run; }; -class dialog_accela: public IFilterDialog +class dialog_accela : public IFilterDialog { Q_OBJECT public: -- cgit v1.2.3 From 963cad86f4ef9941bd272b41d449adc13d742488 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 11:13:20 +0200 Subject: tracker/pt: don't return zero pose on failure Issue: #644 --- tracker-pt/ftnoir_tracker_pt.cpp | 2 -- tracker-pt/point_tracker.h | 1 - 2 files changed, 3 deletions(-) diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index f4e60bba..938acc1c 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -92,8 +92,6 @@ void Tracker_PT::run() s.dynamic_pose ? s.init_phase_timeout : 0); ever_success = true; } - else - point_tracker.invalidate_pose(); { Affine X_CM; diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index b867cea4..a25c1458 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -62,7 +62,6 @@ public: Affine pose() { return X_CM; } vec2 project(const vec3& v_M, f focal_length); vec2 project(const vec3& v_M, f focal_length, const Affine& X_CM); - void invalidate_pose() { X_CM = Affine(); } private: // the points in model order -- cgit v1.2.3 From b0088e4ecb6673ac74ad25ee2195e29345fa3add Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 12:10:05 +0200 Subject: tracker/pt: reduce LED deadzone It qualifies far less often now, but will likely reduce jerkiness. --- tracker-pt/point_tracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index 4022cbb2..73745d8f 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -162,7 +162,7 @@ bool PointTracker::maybe_use_old_point_order(const PointOrder& order, const CamI } // CAVEAT don't increase too much, it visibly loses precision - static constexpr f max_dist = f(.35); + static constexpr f max_dist = f(.2); const bool validp = sum < max_dist; @@ -178,7 +178,7 @@ bool PointTracker::maybe_use_old_point_order(const PointOrder& order, const CamI { static Timer tt; static int cnt1 = 0, cnt2 = 0; - if (tt.elapsed_ms() >= 5000) + if (tt.elapsed_ms() >= 1000) { tt.start(); if (cnt1 + cnt2) -- cgit v1.2.3 From f013741288cbbd9a2e70aea727cbb80cf72d10cc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 13:10:57 +0200 Subject: tracker/pt: specify dynamic pose is only for caps Reported-by: @Len62 as https://github.com/opentrack/opentrack/issues/644#issuecomment-313649989 --- tracker-pt/FTNoIR_PT_Controls.ui | 2 +- tracker-pt/ftnoir_tracker_pt_settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tracker-pt/FTNoIR_PT_Controls.ui b/tracker-pt/FTNoIR_PT_Controls.ui index 62b49747..8d044654 100644 --- a/tracker-pt/FTNoIR_PT_Controls.ui +++ b/tracker-pt/FTNoIR_PT_Controls.ui @@ -250,7 +250,7 @@ - Dynamic pose resolution + Dynamic pose (for caps only, never clips) diff --git a/tracker-pt/ftnoir_tracker_pt_settings.h b/tracker-pt/ftnoir_tracker_pt_settings.h index d890bbd2..79c1e103 100644 --- a/tracker-pt/ftnoir_tracker_pt_settings.h +++ b/tracker-pt/ftnoir_tracker_pt_settings.h @@ -62,7 +62,7 @@ struct settings_pt : opts cap_z(b, "cap-z", 100), fov(b, "camera-fov", 56), dynamic_pose(b, "dynamic-pose-resolution", true), - init_phase_timeout(b, "init-phase-timeout", 500), + init_phase_timeout(b, "init-phase-timeout", 250), auto_threshold(b, "automatic-threshold", true) {} }; -- cgit v1.2.3