summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-19 17:05:11 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-19 17:05:11 +0200
commit65966c1497cbcf2c9556a754ab4e1ddef5957cfb (patch)
tree50a50b68de04861ec5751d1bb61f5743f6d9cee0 /facetracknoir
parent4da0c0619cbf052eb87a618aba4c8de79f0d4325 (diff)
nix camera settings. fix mappings not saving.
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/trackhat-wizard.ui95
-rw-r--r--facetracknoir/wizard.cpp22
-rw-r--r--facetracknoir/wizard.h1
3 files changed, 8 insertions, 110 deletions
diff --git a/facetracknoir/trackhat-wizard.ui b/facetracknoir/trackhat-wizard.ui
index 99c44ba9..059f1629 100644
--- a/facetracknoir/trackhat-wizard.ui
+++ b/facetracknoir/trackhat-wizard.ui
@@ -19,101 +19,6 @@
<property name="options">
<set>QWizard::NoCancelButton</set>
</property>
- <widget class="QWizardPage" name="page_intro">
- <property name="title">
- <string>Introduction</string>
- </property>
- <property name="subTitle">
- <string/>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>This wizard helps you configure TrackHat hardware. Add a logo here. More placeholder text.</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWizardPage" name="page_camera">
- <property name="title">
- <string>Camera setup</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Detected PS3 Eye camera. Setting it up now. A logo and some more placeholder text.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="1">
- <widget class="QComboBox" name="resolution_select">
- <item>
- <property name="text">
- <string>640x480, 75 Hz</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>640x480, 60 Hz</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>320x240, 189 Hz</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>320x240, 120 Hz</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Resolution and framerate</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Field of view</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="camera_fov">
- <item>
- <property name="text">
- <string>56°</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>75°</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
<widget class="QWizardPage" name="page_model">
<property name="title">
<string>Select a model</string>
diff --git a/facetracknoir/wizard.cpp b/facetracknoir/wizard.cpp
index 9ee4ffb8..669a9c27 100644
--- a/facetracknoir/wizard.cpp
+++ b/facetracknoir/wizard.cpp
@@ -53,20 +53,15 @@ void Wizard::set_data()
else // ui.cap_model
m = Cap;
- auto camera_mode = static_cast<CameraMode>(ui.resolution_select->currentIndex());
-
- settings_pt pt;
State state;
set_mapping(state.pose(TZ), tz);
set_mapping(state.pose(Yaw), yaw);
set_mapping(state.pose(Pitch), pitch);
set_mapping(state.pose(Roll), roll);
+ state.pose.save_mappings();
- pt.threshold = 31;
- pt.min_point_size = 2;
- pt.max_point_size = 50;
-
+ settings_pt pt;
switch (m)
{
default:
@@ -74,9 +69,12 @@ void Wizard::set_data()
case ClipRight: pt.t_MH_x = ClipRightX; pt.t_MH_y = 0; pt.t_MH_z = 0; break;
case ClipLeft: pt.t_MH_x = ClipLeftX; pt.t_MH_y = 0; pt.t_MH_z = 0; break;
}
-
- pt.camera_mode = camera_mode;
- pt.fov = ui.camera_fov->currentIndex();
+ pt.threshold = 31;
+ pt.min_point_size = 2;
+ pt.max_point_size = 50;
+ pt.fov = 1;
+ pt.camera_mode = 0;
+ pt.b->save();
settings_accela acc;
acc.ewma = 49;
@@ -84,9 +82,5 @@ void Wizard::set_data()
acc.rot_deadzone = 29;
acc.trans_deadzone = 33;
acc.trans_threshold = 19;
-
acc.b->save();
- pt.b->save();
-
- qDebug() << "wizard done" << "model" << m << "camera-mode" << camera_mode;
}
diff --git a/facetracknoir/wizard.h b/facetracknoir/wizard.h
index 9b0172f5..b0398915 100644
--- a/facetracknoir/wizard.h
+++ b/facetracknoir/wizard.h
@@ -16,7 +16,6 @@ public:
enum Model { Cap, ClipRight, ClipLeft };
enum { ClipRightX = 135, ClipLeftX = -135 };
- enum CameraMode { x640_480_75, x640_480_60, x320_240_189, x320_240_120 };
private slots:
void set_data();
};