summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_SM
diff options
context:
space:
mode:
Diffstat (limited to 'FTNoIR_Tracker_SM')
-rw-r--r--FTNoIR_Tracker_SM/FTNoIR_SM_Controls.ui434
-rw-r--r--FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h8
-rw-r--r--FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp25
-rw-r--r--FTNoIR_Tracker_SM/ftnoir_tracker_faceapi_dialog.cpp20
4 files changed, 173 insertions, 314 deletions
diff --git a/FTNoIR_Tracker_SM/FTNoIR_SM_Controls.ui b/FTNoIR_Tracker_SM/FTNoIR_SM_Controls.ui
index 9fa1b2e4..93befd19 100644
--- a/FTNoIR_Tracker_SM/FTNoIR_SM_Controls.ui
+++ b/FTNoIR_Tracker_SM/FTNoIR_SM_Controls.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>383</width>
- <height>344</height>
+ <width>388</width>
+ <height>313</height>
</rect>
</property>
<property name="windowTitle">
@@ -93,272 +93,170 @@
</layout>
</item>
<item>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="1" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Roll:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Pitch:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Yaw:</string>
- </property>
- </widget>
- </item>
- <item row="1" 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="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string>Enable Axis:</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_12">
- <property name="text">
- <string>X:</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_13">
- <property name="text">
- <string>Y:</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_14">
- <property name="text">
- <string>Z:</string>
- </property>
- </widget>
- </item>
- <item row="2" 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="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="3" 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="3" column="2">
- <widget class="QCheckBox" name="chkInvertYaw">
- <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="QCheckBox" name="chkInvertPitch">
- <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="QCheckBox" name="chkInvertRoll">
- <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="0" column="2">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>Invert Axis:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <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="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <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="6" column="1">
- <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>
- <item row="4" column="2">
- <widget class="QCheckBox" name="chkInvertX">
- <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="5" column="2">
- <widget class="QCheckBox" name="chkInvertY">
- <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="6" column="2">
- <widget class="QCheckBox" name="chkInvertZ">
- <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 class="QGroupBox" name="groupBox">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Enable Axis</string>
+ </property>
+ <widget class="QWidget" name="">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>55</width>
+ <height>110</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Roll:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Pitch:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Yaw:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" 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="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_12">
+ <property name="text">
+ <string>X:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>Y:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_14">
+ <property name="text">
+ <string>Z:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" 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="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" 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="3" column="1">
+ <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="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <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="5" column="1">
+ <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>
+ </widget>
</item>
<item>
<spacer name="verticalSpacer">
diff --git a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
index ce8f5511..b7aed1d0 100644
--- a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
+++ b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
@@ -44,6 +44,7 @@ public:
void StartTracker( HWND parent_window );
void StopTracker( bool exit );
bool GiveHeadPoseData(THeadPoseData *data); // Returns true if confidence is good
+
void loadSettings();
bool SMCreateMapping();
@@ -63,13 +64,6 @@ private:
bool bEnableX;
bool bEnableY;
bool bEnableZ;
-
- double dInvertRoll;
- double dInvertPitch;
- double dInvertYaw;
- double dInvertX;
- double dInvertY;
- double dInvertZ;
};
// Widget that has controls for SMoIR protocol client-settings.
diff --git a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
index f8320294..624e35a0 100644
--- a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
+++ b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
@@ -44,13 +44,6 @@ FTNoIR_Tracker::~FTNoIR_Tracker()
bEnableY = true;
bEnableZ = true;
- dInvertRoll = 1.0f;
- dInvertPitch = 1.0f;
- dInvertYaw = 1.0f;
- dInvertX = 1.0f;
- dInvertY = 1.0f;
- dInvertZ = 1.0f;
-
CloseHandle( hSMMutex );
CloseHandle( hSMMemMap );
hSMMemMap = 0;
@@ -132,22 +125,22 @@ bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
// Copy the measurements to FaceTrackNoIR.
//
if (bEnableX) {
- data->x = dInvertX * pMemData->data.new_pose.head_pos.x * 100.0f; // From meters to centimeters
+ data->x = pMemData->data.new_pose.head_pos.x * 100.0f; // From meters to centimeters
}
if (bEnableY) {
- data->y = dInvertY * pMemData->data.new_pose.head_pos.y * 100.0f;
+ data->y = pMemData->data.new_pose.head_pos.y * 100.0f;
}
if (bEnableZ) {
- data->z = dInvertZ * pMemData->data.new_pose.head_pos.z * 100.0f;
+ data->z = pMemData->data.new_pose.head_pos.z * 100.0f;
}
if (bEnableYaw) {
- data->yaw = dInvertYaw * pMemData->data.new_pose.head_rot.y_rads * 57.295781f; // From rads to degrees
+ data->yaw = pMemData->data.new_pose.head_rot.y_rads * 57.295781f; // From rads to degrees
}
if (bEnablePitch) {
- data->pitch = dInvertPitch * pMemData->data.new_pose.head_rot.x_rads * 57.295781f;
+ data->pitch = pMemData->data.new_pose.head_rot.x_rads * 57.295781f;
}
if (bEnableRoll) {
- data->roll = dInvertRoll * pMemData->data.new_pose.head_rot.z_rads * 57.295781f;
+ data->roll = pMemData->data.new_pose.head_rot.z_rads * 57.295781f;
}
//
@@ -178,12 +171,6 @@ void FTNoIR_Tracker::loadSettings() {
if (pMemData) {
pMemData->initial_filter_level = iniFile.value ( "FilterLevel", 1 ).toInt();
}
- dInvertRoll = (iniFile.value ( "InvertRoll", 0 ).toBool()) ? -1.0f : 1.0f;
- dInvertPitch = (iniFile.value ( "InvertPitch", 0 ).toBool()) ? -1.0f : 1.0f;
- dInvertYaw = (iniFile.value ( "InvertYaw", 0 ).toBool()) ? -1.0f : 1.0f;
- dInvertX = (iniFile.value ( "InvertX", 0 ).toBool()) ? -1.0f : 1.0f;
- dInvertY = (iniFile.value ( "InvertY", 0 ).toBool()) ? -1.0f : 1.0f;
- dInvertZ = (iniFile.value ( "InvertZ", 0 ).toBool()) ? -1.0f : 1.0f;
bEnableRoll = iniFile.value ( "EnableRoll", 1 ).toBool();
bEnablePitch = iniFile.value ( "EnablePitch", 1 ).toBool();
diff --git a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi_dialog.cpp b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi_dialog.cpp
index 7d16b3e3..e334f932 100644
--- a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi_dialog.cpp
+++ b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi_dialog.cpp
@@ -65,13 +65,6 @@ QWidget()
timUpdateSettings->start(100);
connect(this, SIGNAL(stateChanged( int )), this, SLOT(showSettings( int )));
- connect(ui.chkInvertRoll, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
- connect(ui.chkInvertPitch, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
- connect(ui.chkInvertYaw, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
- connect(ui.chkInvertX, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
- connect(ui.chkInvertY, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
- connect(ui.chkInvertZ, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
-
connect(ui.chkEnableRoll, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
connect(ui.chkEnablePitch, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
connect(ui.chkEnableYaw, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
@@ -166,13 +159,6 @@ void TrackerControls::loadSettings() {
iniFile.beginGroup ( "SMTracker" );
ui.cbxFilterSetting->setCurrentIndex(iniFile.value ( "FilterLevel", 1 ).toInt());
- ui.chkInvertRoll->setChecked(iniFile.value ( "InvertRoll", 0 ).toBool());
- ui.chkInvertPitch->setChecked(iniFile.value ( "InvertPitch", 0 ).toBool());
- ui.chkInvertYaw->setChecked(iniFile.value ( "InvertYaw", 0 ).toBool());
- ui.chkInvertX->setChecked(iniFile.value ( "InvertX", 0 ).toBool());
- ui.chkInvertY->setChecked(iniFile.value ( "InvertY", 0 ).toBool());
- ui.chkInvertZ->setChecked(iniFile.value ( "InvertZ", 0 ).toBool());
-
ui.chkEnableRoll->setChecked(iniFile.value ( "EnableRoll", 1 ).toBool());
ui.chkEnablePitch->setChecked(iniFile.value ( "EnablePitch", 1 ).toBool());
ui.chkEnableYaw->setChecked(iniFile.value ( "EnableYaw", 1 ).toBool());
@@ -197,12 +183,6 @@ void TrackerControls::save() {
iniFile.beginGroup ( "SMTracker" );
iniFile.setValue ( "FilterLevel", ui.cbxFilterSetting->currentIndex() );
- iniFile.setValue ( "InvertRoll", ui.chkInvertRoll->isChecked() );
- iniFile.setValue ( "InvertPitch", ui.chkInvertPitch->isChecked() );
- iniFile.setValue ( "InvertYaw", ui.chkInvertYaw->isChecked() );
- iniFile.setValue ( "InvertX", ui.chkInvertX->isChecked() );
- iniFile.setValue ( "InvertY", ui.chkInvertY->isChecked() );
- iniFile.setValue ( "InvertZ", ui.chkInvertZ->isChecked() );
iniFile.setValue ( "EnableRoll", ui.chkEnableRoll->isChecked() );
iniFile.setValue ( "EnablePitch", ui.chkEnablePitch->isChecked() );