summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_hydra
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-22 11:39:07 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-22 11:39:07 +0200
commitfb0cd9401e26aaf610356ffe899af268012d18c3 (patch)
treed8dde935c2dc989ffa7612d74ace482f8c4e50d1 /ftnoir_tracker_hydra
parent461cb6e8f2b141a2408a4caf1fab930c24b19516 (diff)
remove obsolete axis selector from trackers
Diffstat (limited to 'ftnoir_tracker_hydra')
-rw-r--r--ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui168
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp43
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.h15
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp7
4 files changed, 20 insertions, 213 deletions
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>172</width>
- <height>145</height>
+ <width>190</width>
+ <height>62</height>
</rect>
</property>
<property name="windowTitle">
@@ -26,167 +26,15 @@
<property name="autoFillBackground">
<bool>false</bool>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="groupBox_3">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>85</height>
- </size>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>None whatsoever</string>
</property>
- <property name="title">
- <string>Enable Axis</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_61">
- <property name="text">
- <string>Pitch:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="chkEnablePitch">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>X:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QCheckBox" name="chkEnableX">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_91">
- <property name="text">
- <string>Yaw:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="chkEnableYaw">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Y:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="chkEnableY">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_111">
- <property name="text">
- <string>Roll:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkEnableRoll">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>Z:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QCheckBox" name="chkEnableZ">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
</widget>
</item>
- <item>
+ <item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
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 <sixense.h>
-#include <sixense_math.hpp>
+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 <sixense_math.hpp>
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<bool> 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() {