From fb0cd9401e26aaf610356ffe899af268012d18c3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 22 Sep 2014 11:39:07 +0200 Subject: remove obsolete axis selector from trackers --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 449 +++++++++------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 24 +- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 7 - ftnoir_tracker_freepie-udp/freepie-udp-controls.ui | 159 +------- .../ftnoir_tracker_freepie-udp.cpp | 9 +- .../ftnoir_tracker_freepie-udp.h | 6 +- .../ftnoir_tracker_freepie-udp_dialog.cpp | 3 - ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 26 +- ftnoir_tracker_ht/ftnoir_tracker_ht.h | 7 - ftnoir_tracker_ht/ht-trackercontrols.ui | 91 +---- .../ftnoir_hydra_clientcontrols.ui | 168 +------- ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp | 43 +- ftnoir_tracker_hydra/ftnoir_tracker_hydra.h | 15 +- .../ftnoir_tracker_hydra_dialog.cpp | 7 - ftnoir_tracker_pt/FTNoIR_PT_Controls.ui | 245 ----------- ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp | 7 - ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h | 9 - ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui | 200 +-------- ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | 19 +- ftnoir_tracker_rift/ftnoir_tracker_rift.h | 8 +- ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp | 8 - ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui | 358 +--------------- ftnoir_tracker_udp/ftnoir_tracker_udp.cpp | 14 +- ftnoir_tracker_udp/ftnoir_tracker_udp.h | 10 +- ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp | 10 +- 25 files changed, 281 insertions(+), 1621 deletions(-) diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index be237e3c..e5654bd5 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 636 - 346 + 368 @@ -19,243 +19,239 @@ 0 - - - 6666 - 6666 - - - HT tracker settings + Tracker settings - - - 7 - - - + + + - Head position + - - Qt::AlignCenter + + true - - - - - TY - - - - - + + + - TX + Horizontal FOV - - - - - 0 - 0 - + + + + - -10000.000000000000000 + 35.000000000000000 - 10000.000000000000000 + 180.000000000000000 + + + 52.000000000000000 - - + + - TZ + Frames per second - - - - - 0 - 0 - - - - -10000.000000000000000 - - - 10000.000000000000000 - + + + + + Default + + + + + 30 + + + + + 60 + + + + + 120 + + + + + 180 + + - - - - - 0 - 0 - - - - -10000.000000000000000 - - - 10000.000000000000000 + + + + Camera name - - + + + + + - Calibrate + Resolution - - - - - - - Enable axes - - - - 7 - - - 6 - - - 0 - - - 6 - - - 0 - - - - - RX - + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + - - + + - TX + Red channel only - - + + - RY + Mileage may vary - - + + - TY + Marker pitch - - - - RZ + + + + -180.000000000000000 + + + 180.000000000000000 - - - - TZ + + + + Head center + + + + + Calibrate + + + + + + + TX + + + + + + + + 0 + 0 + + + + -10000.000000000000000 + + + 10000.000000000000000 + + + + + + + + 0 + 0 + + + + -10000.000000000000000 + + + 10000.000000000000000 + + + + + + + + 0 + 0 + + + + -10000.000000000000000 + + + 10000.000000000000000 + + + + + + + TZ + + + + + + + TY + + + + - - - - Frames per second - - - - - - - - - - - Default - - - - - 30 - - - - - 60 - - - - - 120 - - - - - 180 - - - - - - - - Recommended! - - - - - - - Camera name - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - + @@ -270,7 +266,7 @@ Qt::RichText - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true @@ -286,93 +282,16 @@ - - - - Red channel only - - - - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - - - - - Horizontal FOV - - - - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - -180.000000000000000 - - - 180.000000000000000 - - - - - - - Resolution - - - - - - - Marker pitch - - - - cameraFOV - cameraFPS - cameraName - resolution - red_only - marker_pitch - cx - cy - cz - rx - ry - rz - tx - ty - tz buttonBox diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index b70bef09..f469c7a4 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -380,18 +380,12 @@ void Tracker::GetHeadPoseData(double *data) { QMutexLocker lck(&mtx); - if (s.eyaw) - data[Yaw] = pose[Yaw]; - if (s.epitch) - data[Pitch] = pose[Pitch]; - if (s.eroll) - data[Roll] = pose[Roll]; - if (s.ex) - data[TX] = pose[TX] * .1; - if (s.ey) - data[TY] = pose[TY] * .1; - if (s.ez) - data[TZ] = pose[TZ] * .1; + data[Yaw] = pose[Yaw]; + data[Pitch] = pose[Pitch]; + data[Roll] = pose[Roll]; + data[TX] = pose[TX] * .1; + data[TY] = pose[TY] * .1; + data[TZ] = pose[TZ] * .1; } class TrackerDll : public Metadata @@ -456,12 +450,6 @@ TrackerControls::TrackerControls() tie_setting(s.resolution, ui.resolution); tie_setting(s.force_fps, ui.cameraFPS); tie_setting(s.fov, ui.cameraFOV); - tie_setting(s.eyaw, ui.rx); - tie_setting(s.epitch, ui.ry); - tie_setting(s.eroll, ui.rz); - tie_setting(s.ex, ui.tx); - tie_setting(s.ey, ui.ty); - tie_setting(s.ez, ui.tz); tie_setting(s.headpos_x, ui.cx); tie_setting(s.headpos_y, ui.cy); tie_setting(s.headpos_z, ui.cz); diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index f2207aef..c431d27a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -28,7 +28,6 @@ struct settings { value fov, headpos_x, headpos_y, headpos_z; value camera_index, force_fps, resolution; value red_only; - value eyaw, epitch, eroll, ex, ey, ez; value marker_pitch; settings() : b(bundle("aruco-tracker")), @@ -40,12 +39,6 @@ struct settings { force_fps(b, "force-fps", 0), resolution(b, "force-resolution", 0), red_only(b, "red-only", false), - eyaw(b, "enable-y", true), - epitch(b, "enable-p", true), - eroll(b, "enable-r", true), - ex(b, "enable-x", true), - ey(b, "enable-y", true), - ez(b, "enable-z", true), marker_pitch(b, "marker-pitch", 0) {} }; diff --git a/ftnoir_tracker_freepie-udp/freepie-udp-controls.ui b/ftnoir_tracker_freepie-udp/freepie-udp-controls.ui index 937dafaa..9870372a 100644 --- a/ftnoir_tracker_freepie-udp/freepie-udp-controls.ui +++ b/ftnoir_tracker_freepie-udp/freepie-udp-controls.ui @@ -9,8 +9,8 @@ 0 0 - 208 - 240 + 198 + 71 @@ -26,145 +26,31 @@ false - - - 0 - - - - - - - - 0 - - - 65535 - - - - - - - - 0 - 0 - - - - UDP port - - - - + + + + + + 0 + 0 + + + + UDP port + - - - - - 0 - 85 - + + + + 0 - - Enable axis + + 65535 - - - - - - 0 - 0 - - - - Roll - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 0 - 0 - - - - Yaw - - - - - - - - 0 - 0 - - - - Pitch - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -173,9 +59,6 @@ - - port - diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp index 7223a33f..718ec510 100644 --- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp +++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp @@ -92,12 +92,9 @@ void TrackerImpl::GetHeadPoseData(double *data) if (s.enable_z) data[TZ] = pose[TZ]; #endif - if (s.enable_yaw) - data[Yaw] = pose[Yaw]; - if (s.enable_pitch) - data[Pitch] = pose[Pitch]; - if (s.enable_roll) - data[Roll] = pose[Roll]; + data[Yaw] = pose[Yaw]; + data[Pitch] = pose[Pitch]; + data[Roll] = pose[Roll]; } extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor() diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.h b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.h index 8cefb509..b3f028fc 100644 --- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.h +++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.h @@ -16,13 +16,9 @@ using namespace options; struct settings { pbundle b; value port; - value enable_roll, enable_pitch, enable_yaw; settings() : b(bundle("freepie-udp-tracker")), - port(b, "port", 4237), - enable_roll(b, "enable-roll", true), - enable_pitch(b, "enable-pitch", true), - enable_yaw(b, "enable-yaw", true) + port(b, "port", 4237) {} }; diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp index d845ff4a..1489e336 100644 --- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp +++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp @@ -9,9 +9,6 @@ TrackerDialog::TrackerDialog() connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); tie_setting(s.port, ui.port); - tie_setting(s.enable_yaw, ui.chkEnableYaw); - tie_setting(s.enable_pitch, ui.chkEnablePitch); - tie_setting(s.enable_roll, ui.chkEnableRoll); } void TrackerDialog::doOK() { diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index ef7e185d..7d6fc24e 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -197,24 +197,16 @@ void Tracker::GetHeadPoseData(double *data) shm->frame.width = 0; } if (shm->result.filled) { - if (s.enableRX) - data[Yaw] = shm->result.rotx; - if (s.enableRY) { - data[Pitch] = shm->result.roty; - } - if (s.enableRZ) { - data[Roll] = shm->result.rotz; - } - if (s.enableTX) - data[TX] = shm->result.tx; - if (s.enableTY) - data[TY] = shm->result.ty; - if (s.enableTZ) - data[TZ] = shm->result.tz; if (fabs(data[Yaw]) > 60 || fabs(data[Pitch]) > 50 || fabs(data[Roll]) > 40) { shm->pause = true; } + data[Yaw] = shm->result.rotx; + data[Pitch] = shm->result.roty; + data[Roll] = shm->result.rotz; + data[TX] = shm->result.tx; + data[TY] = shm->result.ty; + data[TZ] = shm->result.tz; } else { shm->pause = false; } @@ -267,12 +259,6 @@ TrackerControls::TrackerControls() tie_setting(s.camera_idx, ui.cameraName); tie_setting(s.fps, ui.cameraFPS); tie_setting(s.fov, ui.cameraFOV); - tie_setting(s.enableTX, ui.tx); - tie_setting(s.enableTY, ui.ty); - tie_setting(s.enableTZ, ui.tz); - tie_setting(s.enableRX, ui.rx); - tie_setting(s.enableRY, ui.ry); - tie_setting(s.enableRZ, ui.rz); tie_setting(s.resolution, ui.resolution); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index 583249dc..418137bc 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -20,17 +20,10 @@ using namespace options; struct settings { pbundle b; - value enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ; value fov; value fps, camera_idx, resolution; settings() : b(bundle("HT-Tracker")), - enableTX(b, "enable-tx", true), - enableTY(b, "enable-ty", true), - enableTZ(b, "enable-tz", true), - enableRX(b, "enable-rx", true), - enableRY(b, "enable-ry", true), - enableRZ(b, "enable-rz", true), fov(b, "fov", 56), fps(b, "fps", 0), camera_idx(b, "camera-index", 0), diff --git a/ftnoir_tracker_ht/ht-trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui index f57022c8..0b94ffc5 100644 --- a/ftnoir_tracker_ht/ht-trackercontrols.ui +++ b/ftnoir_tracker_ht/ht-trackercontrols.ui @@ -9,8 +9,8 @@ 0 0 - 531 - 166 + 354 + 158 @@ -52,91 +52,6 @@ - - - - Enable axes - - - - - 10 - 20 - 70 - 17 - - - - RX - - - - - - 10 - 40 - 70 - 17 - - - - RY - - - - - - 10 - 60 - 70 - 17 - - - - RZ - - - - - - 60 - 20 - 70 - 17 - - - - TX - - - - - - 60 - 40 - 70 - 17 - - - - TY - - - - - - 60 - 60 - 70 - 17 - - - - TZ - - - - @@ -214,7 +129,7 @@ - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui index e5e41bec..7cfac075 100644 --- a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui +++ b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui @@ -9,8 +9,8 @@ 0 0 - 172 - 145 + 190 + 62 @@ -26,167 +26,15 @@ false - - - - - - 0 - 85 - + + + + + None whatsoever - - Enable Axis - - - - - - Pitch: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - X: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - Yaw: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Y: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Roll: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Z: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp index 6345ac57..5770f015 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp @@ -8,13 +8,10 @@ # define SIXENSE_UTILS_STATIC_LIB #endif #include -#include +Hydra_Tracker::Hydra_Tracker() : should_quit(false) {} -Hydra_Tracker::Hydra_Tracker() : should_quit(false) -{ - for (int i = 0; i < 6; i++) - newHeadPose[i] = 0; -} +#pragma GCC diagnostic ignored "-Wreorder" +#include Hydra_Tracker::~Hydra_Tracker() { @@ -38,33 +35,13 @@ void Hydra_Tracker::GetHeadPoseData(double *data) float ypr[3]; mat.getEulerAngles().fill(ypr); - newHeadPose[Yaw] = ypr[0]; - newHeadPose[Pitch] = ypr[1]; - newHeadPose[Roll] = ypr[2]; - - - newHeadPose[TX] = acd.controllers[0].pos[0]/50.0f; - newHeadPose[TY] = acd.controllers[0].pos[1]/50.0f; - newHeadPose[TZ] = acd.controllers[0].pos[2]/50.0f; - - if (s.bEnableX) { - data[TX] = newHeadPose[TX]; - } - if (s.bEnableY) { - data[TY] = newHeadPose[TY]; - } - if (s.bEnableY) { - data[TZ] = newHeadPose[TZ]; - } - if (s.bEnableYaw) { - data[Yaw] = newHeadPose[Yaw] * 57.295781f; - } - if (s.bEnablePitch) { - data[Pitch] = newHeadPose[Pitch] * 57.295781f; - } - if (s.bEnableRoll) { - data[Roll] = newHeadPose[Roll] * 57.295781f; - } + data[TX] = acd.controllers[0].pos[0]/50.0; + data[TY] = acd.controllers[0].pos[1]/50.0; + data[TZ] = acd.controllers[0].pos[2]/50.0; + constexpr double r2d = 57.295781; + data[Yaw] = ypr[0] * r2d; + data[Pitch] = ypr[1] * r2d; + data[Roll] = ypr[2] * r2d; } extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor() diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h index fdfc2643..2b3c84a7 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h @@ -6,15 +6,8 @@ using namespace options; struct settings { pbundle b; - value bEnableRoll, bEnablePitch, bEnableYaw, bEnableX, bEnableY, bEnableZ; settings() : - b(bundle("tracker-hydra")), - bEnableRoll(b, "enable-rz", true), - bEnablePitch(b, "enable-ry", true), - bEnableYaw(b, "enable-rx", true), - bEnableX(b, "enable-tx", true), - bEnableY(b, "enable-ty", true), - bEnableZ(b, "enable-tz", true) + b(bundle("tracker-hydra")) {} }; @@ -25,15 +18,11 @@ public: ~Hydra_Tracker(); void StartTracker(QFrame *) override; void GetHeadPoseData(double *data) override; + virtual int preferredHz() override { return 250; } volatile bool should_quit; -protected: - void run(); // qthread override run method private: settings s; - bool isCalibrated; - double newHeadPose[6]; // Structure with new headpose QMutex mutex; - virtual int preferredHz() override { return 250; } }; class TrackerControls: public QWidget, public ITrackerDialog diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp index 6c98a0a1..3df77d15 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp @@ -9,13 +9,6 @@ QWidget() // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - - tie_setting(s.bEnableYaw, ui.chkEnableYaw); - tie_setting(s.bEnablePitch, ui.chkEnablePitch); - tie_setting(s.bEnableRoll, ui.chkEnableRoll); - tie_setting(s.bEnableX, ui.chkEnableX); - tie_setting(s.bEnableY, ui.chkEnableY); - tie_setting(s.bEnableZ, ui.chkEnableZ); } void TrackerControls::doOK() { diff --git a/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui b/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui index 0bbec7e1..44dfc060 100644 --- a/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui +++ b/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui @@ -129,245 +129,6 @@ - - - - - 0 - 85 - - - - Enable Axis - - - - - - - - Roll: - - - chkEnableRoll - - - - - - - Pitch: - - - chkEnablePitch - - - - - - - Yaw: - - - chkEnableYaw - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - X: - - - chkEnableX - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Y: - - - chkEnableY - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Z: - - - chkEnableZ - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 40 - 20 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - @@ -1723,12 +1484,6 @@ tabWidget reset_spin - chkEnableRoll - chkEnablePitch - chkEnableYaw - chkEnableX - chkEnableY - chkEnableZ camdevice_combo res_x_spin res_y_spin diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp index 00d10d13..4ba981a5 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp @@ -57,13 +57,6 @@ TrackerDialog::TrackerDialog() tie_setting(s.threshold_secondary, ui.threshold_secondary_slider); tie_setting(s.threshold, ui.threshold_slider); - tie_setting(s.bEnableYaw, ui.chkEnableYaw); - tie_setting(s.bEnablePitch, ui.chkEnablePitch); - tie_setting(s.bEnableRoll, ui.chkEnableRoll); - tie_setting(s.bEnableX, ui.chkEnableX); - tie_setting(s.bEnableY, ui.chkEnableY); - tie_setting(s.bEnableZ, ui.chkEnableZ); - tie_setting(s.min_point_size, ui.mindiam_spin); tie_setting(s.max_point_size, ui.maxdiam_spin); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h index 109090b3..1eca1e35 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h @@ -38,9 +38,6 @@ struct settings value reset_time; - value bEnableYaw, bEnablePitch, bEnableRoll; - value bEnableX, bEnableY, bEnableZ; - value clip_ty, clip_tz, clip_by, clip_bz; value active_model_panel, cap_x, cap_y, cap_z; @@ -70,12 +67,6 @@ struct settings t_MH_y(b, "model-centroid-y", 0), t_MH_z(b, "model-centroid-z", 0), reset_time(b, "reset-time", 2000), - bEnableYaw(b, "enable-yaw", true), - bEnablePitch(b, "enable-pitch", true), - bEnableRoll(b, "enable-roll", true), - bEnableX(b, "enable-x", true), - bEnableY(b, "enable-y", true), - bEnableZ(b, "enable-z", true), clip_ty(b, "clip-ty", 0), clip_tz(b, "clip-tz", 0), clip_by(b, "clip-by", 0), diff --git a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui index 62edbec5..20c8f00b 100644 --- a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui +++ b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui @@ -9,8 +9,8 @@ 0 0 - 532 - 481 + 218 + 200 @@ -33,7 +33,7 @@ false - + Yaw spring @@ -151,7 +151,7 @@ - + @@ -164,198 +164,6 @@ - - - - Axes - - - false - - - - QFormLayout::ExpandingFieldsGrow - - - - - - 0 - 0 - - - - Pitch: - - - - - - - - 0 - 0 - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - - 0 - 0 - - - - Yaw: - - - - - - - - 0 - 0 - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 0 - 0 - - - - Roll: - - - - - - - - 0 - 0 - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 0 - 0 - - - - X - - - - - - - Qt::LeftToRight - - - - - - - - - - - 0 - 0 - - - - Y - - - - - - - Qt::LeftToRight - - - - - - - - - - - 0 - 0 - - - - Z - - - - - - - Qt::LeftToRight - - - - - - - - - diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp index 33d8f418..46e8c29f 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp @@ -55,18 +55,13 @@ void Rift_Tracker::GetHeadPoseData(double *data) yaw += s.constant_drift; old_yaw=yaw; } - if (s.bEnableYaw) - data[Yaw] = yaw * 57.295781; - if (s.bEnablePitch) - data[Pitch] = pitch * -57.295781; - if (s.bEnableRoll) - data[Roll] = roll * 57.295781; - if (s.bEnableX) - data[TX] = pose.Position.x * -1e2; - if (s.bEnableY) - data[TY] = pose.Position.y * 1e2; - if (s.bEnableX) - data[TZ] = pose.Position.z * 1e2; + constexpr double d2r = 57.295781; + data[Yaw] = yaw * d2r; + data[Pitch] = pitch * -d2r; + data[Roll] = roll * d2r; + data[TX] = pose.Position.x * -1e2; + data[TY] = pose.Position.y * 1e2; + data[TZ] = pose.Position.z * 1e2; } } } diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.h b/ftnoir_tracker_rift/ftnoir_tracker_rift.h index ee51b2cb..de224ca5 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.h +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.h @@ -12,16 +12,10 @@ using namespace options; struct settings { pbundle b; - value bEnableYaw, bEnablePitch, bEnableRoll, bEnableX, bEnableY, bEnableZ, useYawSpring; + value useYawSpring; value constant_drift, persistence, deadzone; settings() : b(bundle("Rift")), - bEnableYaw(b, "EnableYaw", true), - bEnablePitch(b, "EnablePitch", true), - bEnableRoll(b, "EnableRoll", true), - bEnableX(b, "EnableX", true), - bEnableY(b, "EnableY", true), - bEnableZ(b, "EnableZ", true), useYawSpring(b, "yaw-spring", false), constant_drift(b, "constant-drift", 0.000005), persistence(b, "persistence", 0.99999), diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp index cc8079bf..390eac0e 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp @@ -9,14 +9,6 @@ QWidget() connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - tie_setting(s.bEnableYaw, ui.chkEnableYaw); - tie_setting(s.bEnablePitch, ui.chkEnablePitch); - tie_setting(s.bEnableRoll, ui.chkEnableRoll); - - tie_setting(s.bEnableX, ui.chkEnableX); - tie_setting(s.bEnableY, ui.chkEnableY); - tie_setting(s.bEnableZ, ui.chkEnableZ); - tie_setting(s.constant_drift, ui.constantDrift); tie_setting(s.deadzone, ui.deadzone); tie_setting(s.persistence, ui.persistence); diff --git a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui index 6f81a50b..f485e67f 100644 --- a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui +++ b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui @@ -9,8 +9,8 @@ 0 0 - 411 - 232 + 216 + 71 @@ -26,353 +26,35 @@ false - - - - - - - Port-number - - - - - - - 0 - - - 65535 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 85 - - - - Enable Axis + + + + + Port - - - - 10 - 20 - 150 - 73 - - - - - - - Roll: - - - - - - - Pitch: - - - - - - - Yaw: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - X: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Y: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Z: - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 40 - 20 - - - - - - - - - - Qt::Vertical + + + + 0 - - - 20 - 40 - + + 65535 - - - - - - - - Enter the port-number for the remote PC. - - - true - - - - - - - Remember: you may have to change firewall-settings too! - - - - + - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - OK - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Cancel - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + spinPortNumber - btnOK - btnCancel diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp index 1b6d9ddd..335616d5 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp @@ -62,18 +62,8 @@ void FTNoIR_Tracker::StartTracker(QFrame*) void FTNoIR_Tracker::GetHeadPoseData(double *data) { QMutexLocker foo(&mutex); - if (s.enable_x) - data[TX] = newHeadPose[TX]; - if (s.enable_y) - data[TY] = newHeadPose[TY]; - if (s.enable_z) - data[TZ] = newHeadPose[TZ]; - if (s.enable_yaw) - data[Yaw] = newHeadPose[Yaw]; - if (s.enable_pitch) - data[Pitch] = newHeadPose[Pitch]; - if (s.enable_roll) - data[Roll] = newHeadPose[Roll]; + for (int i = 0; i < 6; i++) + data[i] = last_recv_pose[i]; } extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor() diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h index 22c9c465..92d321b2 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h @@ -10,17 +10,9 @@ using namespace options; struct settings { pbundle b; value port; - value enable_roll, enable_pitch, enable_yaw, - enable_x, enable_y, enable_z; settings() : b(bundle("udp-tracker")), - port(b, "port", 4242), - enable_roll(b, "enable-roll", true), - enable_pitch(b, "enable-pitch", true), - enable_yaw(b, "enable-yaw", true), - enable_x(b, "enable-x", true), - enable_y(b, "enable-y", true), - enable_z(b, "enable-y", true) + port(b, "port", 4242) {} }; diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp index 17b174e8..16a59292 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp @@ -30,15 +30,9 @@ QWidget() { ui.setupUi( this ); - connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); - connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - tie_setting(s.enable_x, ui.chkEnableX); - tie_setting(s.enable_y, ui.chkEnableY); - tie_setting(s.enable_z, ui.chkEnableZ); - tie_setting(s.enable_yaw, ui.chkEnableYaw); - tie_setting(s.enable_pitch, ui.chkEnablePitch); - tie_setting(s.enable_roll, ui.chkEnableRoll); tie_setting(s.port, ui.spinPortNumber); } -- cgit v1.2.3