diff options
Diffstat (limited to 'facetracknoir')
-rwxr-xr-x[-rw-r--r--] | facetracknoir/facetracknoir.ico | bin | 67134 -> 1606046 bytes | |||
-rwxr-xr-x[-rw-r--r--] | facetracknoir/images/facetracknoir.png | bin | 29485 -> 14581 bytes | |||
-rw-r--r-- | facetracknoir/images/trackhat-clip-left.png | bin | 0 -> 136647 bytes | |||
-rw-r--r-- | facetracknoir/images/trackhat-clip-right.png | bin | 0 -> 136867 bytes | |||
-rw-r--r-- | facetracknoir/images/trackhat-hat.png | bin | 0 -> 45281 bytes | |||
-rw-r--r-- | facetracknoir/main.cpp | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | facetracknoir/main.ui | 2267 | ||||
-rw-r--r-- | facetracknoir/options-dialog.cpp | 162 | ||||
-rw-r--r-- | facetracknoir/options-dialog.hpp | 25 | ||||
-rw-r--r-- | facetracknoir/settings.ui | 926 | ||||
-rw-r--r-- | facetracknoir/trackhat-wizard.ui | 189 | ||||
-rw-r--r-- | facetracknoir/trans_calib.cpp | 41 | ||||
-rw-r--r-- | facetracknoir/trans_calib.h | 39 | ||||
-rw-r--r-- | facetracknoir/ui-res.qrc | 3 | ||||
-rw-r--r-- | facetracknoir/ui.cpp | 67 | ||||
-rw-r--r-- | facetracknoir/ui.h | 12 | ||||
-rw-r--r-- | facetracknoir/wizard.cpp | 87 | ||||
-rw-r--r-- | facetracknoir/wizard.h | 21 |
18 files changed, 2616 insertions, 1235 deletions
diff --git a/facetracknoir/facetracknoir.ico b/facetracknoir/facetracknoir.ico Binary files differindex 5cac8da1..fa691557 100644..100755 --- a/facetracknoir/facetracknoir.ico +++ b/facetracknoir/facetracknoir.ico diff --git a/facetracknoir/images/facetracknoir.png b/facetracknoir/images/facetracknoir.png Binary files differindex 85c06df6..4f17de81 100644..100755 --- a/facetracknoir/images/facetracknoir.png +++ b/facetracknoir/images/facetracknoir.png diff --git a/facetracknoir/images/trackhat-clip-left.png b/facetracknoir/images/trackhat-clip-left.png Binary files differnew file mode 100644 index 00000000..e4668cad --- /dev/null +++ b/facetracknoir/images/trackhat-clip-left.png diff --git a/facetracknoir/images/trackhat-clip-right.png b/facetracknoir/images/trackhat-clip-right.png Binary files differnew file mode 100644 index 00000000..aeb969cd --- /dev/null +++ b/facetracknoir/images/trackhat-clip-right.png diff --git a/facetracknoir/images/trackhat-hat.png b/facetracknoir/images/trackhat-hat.png Binary files differnew file mode 100644 index 00000000..2d5a8f4a --- /dev/null +++ b/facetracknoir/images/trackhat-hat.png diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 45483a68..85c4c7bd 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -2,6 +2,7 @@ # include <stdlib.h> #endif +#include "wizard.h" #include "ui.h" #include "opentrack/options.hpp" using namespace options; @@ -58,6 +59,17 @@ int main(int argc, char** argv) QApplication::setAttribute(Qt::AA_X11InitThreads, true); QApplication app(argc, argv); + { + QSettings s(OPENTRACK_ORG); + if (!s.contains("wizard-run-once")) + { + s.setValue("wizard-run-once", true); + auto w = std::make_shared<Wizard>(); + w->show(); + app.exec(); + } + } + auto w = std::make_shared<MainWindow>(); w->show(); diff --git a/facetracknoir/main.ui b/facetracknoir/main.ui index 2328be40..4d8b6caf 100644..100755 --- a/facetracknoir/main.ui +++ b/facetracknoir/main.ui @@ -7,8 +7,8 @@ <rect> <x>0</x> <y>0</y> - <width>708</width> - <height>504</height> + <width>744</width> + <height>473</height> </rect> </property> <property name="windowIcon"> @@ -31,19 +31,25 @@ <number>0</number> </property> <property name="leftMargin"> - <number>0</number> + <number>6</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> - <number>0</number> + <number>6</number> </property> <property name="bottomMargin"> - <number>0</number> + <number>10</number> </property> <item> <widget class="QFrame" name="frame"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> @@ -53,13 +59,7 @@ <property name="lineWidth"> <number>0</number> </property> - <layout class="QFormLayout" name="formLayout"> - <property name="horizontalSpacing"> - <number>0</number> - </property> - <property name="verticalSpacing"> - <number>0</number> - </property> + <layout class="QGridLayout" name="gridLayout"> <property name="leftMargin"> <number>0</number> </property> @@ -72,132 +72,56 @@ <property name="bottomMargin"> <number>0</number> </property> - <item row="0" column="0"> - <widget class="QFrame" name="video_feed"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>480</width> - <height>360</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>480</width> - <height>360</height> - </size> - </property> - <widget class="QFrame" name="video_frame"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>480</width> - <height>360</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <widget class="QLabel" name="video_frame_label"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>480</width> - <height>360</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>480</width> - <height>360</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>480</width> - <height>360</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </widget> - </widget> - </item> - <item row="0" column="1"> - <widget class="QFrame" name="top_display"> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0" colspan="2"> + <widget class="QFrame" name="frame_2"> <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> - <property name="lineWidth"> - <number>0</number> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>12</number> - </property> + <layout class="QGridLayout" name="gridLayout_2"> <property name="leftMargin"> - <number>6</number> + <number>0</number> </property> <property name="topMargin"> - <number>12</number> + <number>0</number> </property> <property name="rightMargin"> - <number>8</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>4</number> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> </property> - <item> - <widget class="GLWidget" name="pose_display" native="true"> + <item row="1" column="0"> + <widget class="QFrame" name="frame_3"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>80</width> - <height>90</height> - </size> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="box_raw_headpose"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> - <property name="title"> - <string notr="true">Raw tracker data</string> - </property> - <layout class="QGridLayout" name="gridLayout_12"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>9</number> + </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> - <number>0</number> + <number>6</number> </property> <property name="rightMargin"> <number>0</number> @@ -205,321 +129,342 @@ <property name="bottomMargin"> <number>0</number> </property> - <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="0" column="1"> - <widget class="QLCDNumber" name="raw_x"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth"> - <number>1</number> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="lblRotX_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>yaw</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLabel" name="lblRotZ_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>roll</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="lblZ_4"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TZ</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="lblRotY_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>pitch</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLCDNumber" name="raw_y"> - <property name="enabled"> - <bool>true</bool> - </property> + <item> + <widget class="QGroupBox" name="groupProfile"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>10</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth"> - <number>1</number> + <property name="title"> + <string>Profile</string> </property> - <property name="smallDecimalPoint"> + <property name="flat"> <bool>true</bool> </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> + <layout class="QGridLayout" name="gridLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>13</number> + </property> + <property name="rightMargin"> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>8</number> + </property> + <property name="verticalSpacing"> + <number>7</number> + </property> + <item row="0" column="0"> + <widget class="QComboBox" name="iconcomboProfile"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>7</horstretch> + <verstretch>5</verstretch> + </sizepolicy> + </property> + <property name="maxVisibleItems"> + <number>10</number> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QToolButton" name="btnSave"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>3</horstretch> + <verstretch>5</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Save</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QToolButton" name="btnLoad"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>7</horstretch> + <verstretch>4</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Load</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QToolButton" name="btnSaveAs"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>3</horstretch> + <verstretch>4</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Save...</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="0" column="3"> - <widget class="QLCDNumber" name="raw_yaw"> - <property name="enabled"> - <bool>true</bool> - </property> + <item> + <widget class="QGroupBox" name="groupStartStop"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth"> - <number>1</number> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QLCDNumber" name="raw_roll"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth"> - <number>1</number> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLCDNumber" name="raw_z"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth"> - <number>1</number> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="lblX_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TX</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QLCDNumber" name="raw_pitch"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>7</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> + <property name="title"> + <string notr="true">Controls</string> </property> - <property name="lineWidth"> - <number>1</number> - </property> - <property name="smallDecimalPoint"> + <property name="flat"> <bool>true</bool> </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Outline</enum> - </property> + <layout class="QGridLayout" name="gridLayout_5"> + <property name="leftMargin"> + <number>4</number> + </property> + <property name="topMargin"> + <number>14</number> + </property> + <property name="rightMargin"> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>10</number> + </property> + <property name="horizontalSpacing"> + <number>6</number> + </property> + <property name="verticalSpacing"> + <number>0</number> + </property> + <item row="0" column="1"> + <widget class="QToolButton" name="btnStopTracker"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>45</height> + </size> + </property> + <property name="text"> + <string>Stop</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QToolButton" name="btnStartTracker"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>45</height> + </size> + </property> + <property name="text"> + <string>Start</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="lblY_4"> - <property name="enabled"> - <bool>true</bool> - </property> + <item> + <widget class="QGroupBox" name="groupWindows"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TY</string> - </property> + <property name="styleSheet"> + <string notr="true">QGroupBox { border: 0; }</string> + </property> + <layout class="QGridLayout" name="gridLayout_10"> + <property name="bottomMargin"> + <number>4</number> + </property> + <item row="0" column="0"> + <widget class="QGroupBox" name="groupGameProtocol"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Protocol</string> + </property> + <property name="flat"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>5</number> + </property> + <property name="leftMargin"> + <number>2</number> + </property> + <property name="topMargin"> + <number>18</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="iconcomboProtocol"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="btnShowServerControls"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>...</string> + </property> + <property name="flat" stdset="0"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="QFrame" name="frame_7"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="btnEditCurves"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Mapping</string> + </property> + <property name="icon"> + <iconset resource="ui-res.qrc"> + <normaloff>:/images/curves.png</normaloff>:/images/curves.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnShortcuts"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Options</string> + </property> + <property name="icon"> + <iconset resource="ui-res.qrc"> + <normaloff>:/images/tools.png</normaloff>:/images/tools.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> </widget> </item> </layout> </widget> </item> - <item> - <widget class="QGroupBox" name="box_mapped_headpose"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="0" column="0"> + <widget class="QFrame" name="frame_6"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> </property> - <property name="title"> - <string notr="true">Game data</string> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_14"> + <layout class="QGridLayout" name="gridLayout_9"> <property name="leftMargin"> <number>0</number> </property> @@ -533,640 +478,916 @@ <number>0</number> </property> <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="1" column="0"> - <widget class="QLabel" name="lblY_2"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TY</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="lblRotY_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>pitch</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLCDNumber" name="pose_x"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="lblRotX_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>yaw</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLabel" name="lblRotZ_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>roll</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="lblZ_2"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TZ</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLCDNumber" name="pose_y"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QLCDNumber" name="pose_roll"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QLCDNumber" name="pose_yaw"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLCDNumber" name="pose_z"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="lblx"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string>TX</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QLCDNumber" name="pose_pitch"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>true</bool> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QFrame" name="bottom_controls"> - <layout class="QGridLayout" name="gridLayout_2"> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="horizontalSpacing"> - <number>6</number> - </property> - <property name="verticalSpacing"> - <number>0</number> - </property> - <item row="1" column="1"> - <widget class="QGroupBox" name="groupStartStop"> - <property name="title"> - <string notr="true">Controls</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_5"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>12</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>12</number> + <number>6</number> </property> - <item row="0" column="1"> - <widget class="QToolButton" name="btnStopTracker"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Stop</string> - </property> - </widget> - </item> <item row="0" column="0"> - <widget class="QToolButton" name="btnStartTracker"> + <widget class="QFrame" name="video_feed"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Start</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="2"> - <widget class="QGroupBox" name="groupWindows"> - <property name="title"> - <string>Settings</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_6"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="1" column="0"> - <widget class="QPushButton" name="btnShortcuts"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Options</string> - </property> - <property name="icon"> - <iconset resource="ui-res.qrc"> - <normaloff>:/images/tools.png</normaloff>:/images/tools.png</iconset> - </property> - <property name="iconSize"> + <property name="minimumSize"> <size> - <width>80</width> - <height>24</height> + <width>480</width> + <height>360</height> </size> </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QPushButton" name="btnEditCurves"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Mapping</string> - </property> - <property name="icon"> - <iconset resource="ui-res.qrc"> - <normaloff>:/images/curves.png</normaloff>:/images/curves.png</iconset> - </property> - <property name="iconSize"> + <property name="maximumSize"> <size> - <width>80</width> - <height>24</height> + <width>480</width> + <height>360</height> </size> </property> + <widget class="QFrame" name="video_frame"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>480</width> + <height>360</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <widget class="QLabel" name="video_frame_label"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>480</width> + <height>360</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>480</width> + <height>360</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>480</width> + <height>360</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </widget> </widget> </item> - </layout> - </widget> - </item> - <item row="0" column="2"> - <widget class="QGroupBox" name="groupFilter"> - <property name="title"> - <string>Filter</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="0" column="0"> - <widget class="QComboBox" name="iconcomboFilter"/> - </item> <item row="0" column="1"> - <widget class="QToolButton" name="btnShowFilterControls"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="flat" stdset="0"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="0"> - <widget class="QGroupBox" name="groupTrackerSource"> - <property name="title"> - <string>Tracker</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="0" column="0"> - <widget class="QComboBox" name="iconcomboTrackerSource"/> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="btnShowEngineControls"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="flat" stdset="0"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="groupGameProtocol"> - <property name="title"> - <string>Protocol</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="0" column="1"> - <widget class="QToolButton" name="btnShowServerControls"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="flat" stdset="0"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QComboBox" name="iconcomboProtocol"/> - </item> - </layout> - </widget> - </item> - <item row="1" column="0"> - <widget class="QGroupBox" name="groupProfile"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Profile</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_7"> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <property name="verticalSpacing"> - <number>2</number> - </property> - <item row="0" column="0"> - <widget class="QComboBox" name="iconcomboProfile"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maxVisibleItems"> - <number>10</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QToolButton" name="btnLoad"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Load</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="btnSave"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Save</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QToolButton" name="btnSaveAs"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Save...</string> + <widget class="QFrame" name="top_display_3"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> </property> + <property name="lineWidth"> + <number>0</number> + </property> + <layout class="QVBoxLayout" name="_3"> + <property name="spacing"> + <number>12</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="GLWidget" name="pose_display" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>110</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="box_raw_headpose_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string notr="true">Raw tracker data</string> + </property> + <layout class="QGridLayout" name="gridLayout_16"> + <property name="leftMargin"> + <number>4</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>3</number> + </property> + <property name="verticalSpacing"> + <number>2</number> + </property> + <item row="0" column="1"> + <widget class="QLCDNumber" name="raw_x"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="lblRotX_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>yaw</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QLabel" name="lblRotZ_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>roll</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="lblZ_6"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Z</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QLabel" name="lblRotY_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>pitch</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLCDNumber" name="raw_y"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QLCDNumber" name="raw_yaw"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QLCDNumber" name="raw_roll"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLCDNumber" name="raw_z"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="lblX_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>X</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="3"> + <widget class="QLCDNumber" name="raw_pitch"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Outline</enum> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="lblY_6"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Y</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="box_mapped_headpose_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string notr="true">Game data</string> + </property> + <layout class="QGridLayout" name="gridLayout_17"> + <property name="leftMargin"> + <number>4</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>3</number> + </property> + <property name="verticalSpacing"> + <number>2</number> + </property> + <item row="1" column="0"> + <widget class="QLabel" name="lblY_7"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Y</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QLabel" name="lblRotY_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>pitch</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLCDNumber" name="pose_x"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="lblRotX_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>yaw</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QLabel" name="lblRotZ_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>roll</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="lblZ_7"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Z</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLCDNumber" name="pose_y"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QLCDNumber" name="pose_roll"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QLCDNumber" name="pose_yaw"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLCDNumber" name="pose_z"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>35</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="lblx_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>X</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="1" column="3"> + <widget class="QLCDNumber" name="pose_pitch"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>88</width> + <height>34</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>4</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> </widget> </item> </layout> @@ -1189,20 +1410,8 @@ </customwidget> </customwidgets> <tabstops> - <tabstop>btnStartTracker</tabstop> - <tabstop>btnStopTracker</tabstop> - <tabstop>iconcomboTrackerSource</tabstop> - <tabstop>btnShowEngineControls</tabstop> <tabstop>iconcomboProtocol</tabstop> <tabstop>btnShowServerControls</tabstop> - <tabstop>iconcomboFilter</tabstop> - <tabstop>btnShowFilterControls</tabstop> - <tabstop>iconcomboProfile</tabstop> - <tabstop>btnLoad</tabstop> - <tabstop>btnSave</tabstop> - <tabstop>btnSaveAs</tabstop> - <tabstop>btnEditCurves</tabstop> - <tabstop>btnShortcuts</tabstop> </tabstops> <resources> <include location="ui-res.qrc"/> diff --git a/facetracknoir/options-dialog.cpp b/facetracknoir/options-dialog.cpp index 1ec26d5e..87b7b349 100644 --- a/facetracknoir/options-dialog.cpp +++ b/facetracknoir/options-dialog.cpp @@ -7,11 +7,12 @@ */ #include "options-dialog.hpp" +#include "ftnoir_tracker_pt/camera.h" #include "keyboard.h" #include <QPushButton> #include <QLayout> -OptionsDialog::OptionsDialog() +OptionsDialog::OptionsDialog(State& state) : state(state), trans_calib_running(false) { ui.setupUi( this ); @@ -25,13 +26,6 @@ OptionsDialog::OptionsDialog() tie_setting(s.s_main.tcomp_p, ui.tcomp_enable); tie_setting(s.s_main.tcomp_tz, ui.tcomp_rz); - tie_setting(s.s_main.a_x.zero, ui.pos_tx); - tie_setting(s.s_main.a_y.zero, ui.pos_ty); - tie_setting(s.s_main.a_z.zero, ui.pos_tz); - tie_setting(s.s_main.a_yaw.zero, ui.pos_rx); - tie_setting(s.s_main.a_pitch.zero, ui.pos_ry); - tie_setting(s.s_main.a_roll.zero, ui.pos_rz); - tie_setting(s.s_main.a_yaw.invert, ui.invert_yaw); tie_setting(s.s_main.a_pitch.invert, ui.invert_pitch); tie_setting(s.s_main.a_roll.invert, ui.invert_roll); @@ -49,6 +43,47 @@ OptionsDialog::OptionsDialog() tie_setting(s.s_main.camera_yaw, ui.camera_yaw); tie_setting(s.s_main.camera_pitch, ui.camera_pitch); tie_setting(s.s_main.camera_roll, ui.camera_roll); + + tie_setting(pt.camera_mode, ui.camera_mode); + + tie_setting(pt.threshold, ui.threshold_slider); + + tie_setting(pt.min_point_size, ui.mindiam_spin); + tie_setting(pt.max_point_size, ui.maxdiam_spin); + + tie_setting(pt.t_MH_x, ui.tx_spin); + tie_setting(pt.t_MH_y, ui.ty_spin); + tie_setting(pt.t_MH_z, ui.tz_spin); + + tie_setting(pt.fov, ui.camera_fov); + + tie_setting(pt.model_used, ui.model_used); + + connect(ui.ewma_slider, SIGNAL(valueChanged(int)), this, SLOT(update_ewma_display(int))); + connect(ui.rotation_slider, SIGNAL(valueChanged(int)), this, SLOT(update_rot_display(int))); + connect(ui.rot_dz_slider, SIGNAL(valueChanged(int)), this, SLOT(update_rot_dz_display(int))); + connect(ui.translation_slider, SIGNAL(valueChanged(int)), this, SLOT(update_trans_display(int))); + connect(ui.trans_dz_slider, SIGNAL(valueChanged(int)), this, SLOT(update_trans_dz_display(int))); + + tie_setting(acc.rot_threshold, ui.rotation_slider); + tie_setting(acc.trans_threshold, ui.translation_slider); + tie_setting(acc.ewma, ui.ewma_slider); + tie_setting(acc.rot_deadzone, ui.rot_dz_slider); + tie_setting(acc.trans_deadzone, ui.trans_dz_slider); + + update_rot_display(ui.rotation_slider->value()); + update_trans_display(ui.translation_slider->value()); + update_ewma_display(ui.ewma_slider->value()); + update_rot_dz_display(ui.rot_dz_slider->value()); + update_trans_dz_display(ui.trans_dz_slider->value()); + + tie_setting(pt.dynamic_pose, ui.dynamic_pose); + tie_setting(pt.init_phase_timeout, ui.init_phase_timeout); + + connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info())); + connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) ); + + timer.start(100); connect(ui.bind_center, &QPushButton::pressed, [&]() -> void { bind_key(s.center.keycode, ui.center_text); }); connect(ui.bind_zero, &QPushButton::pressed, [&]() -> void { bind_key(s.zero.keycode, ui.zero_text); }); @@ -79,7 +114,9 @@ void OptionsDialog::bind_key(value<QString>& ret, QLabel* label) void OptionsDialog::doOK() { s.b->save(); + pt.b->save(); s.s_main.b->save(); + acc.b->save(); ui.game_detector->save(); this->close(); emit reload(); @@ -87,8 +124,117 @@ void OptionsDialog::doOK() { void OptionsDialog::doCancel() { s.b->reload(); + pt.b->reload(); s.s_main.b->reload(); + acc.b->reload(); ui.game_detector->revert(); close(); } +void OptionsDialog::startstop_trans_calib(bool start) +{ + auto tracker = get_pt(); + if (!tracker) + { + ui.tcalib_button->setChecked(false); + return; + } + + if (start) + { + qDebug()<<"TrackerDialog:: Starting translation calibration"; + trans_calib.reset(); + trans_calib_running = true; + pt.t_MH_x = 0; + pt.t_MH_y = 0; + pt.t_MH_z = 0; + } + else + { + qDebug()<<"TrackerDialog:: Stopping translation calibration"; + trans_calib_running = false; + { + auto tmp = trans_calib.get_estimate(); + pt.t_MH_x = tmp[0]; + pt.t_MH_y = tmp[1]; + pt.t_MH_z = tmp[2]; + } + } +} + +void OptionsDialog::poll_tracker_info() +{ + auto tracker = get_pt(); + CamInfo info; + if (tracker && tracker->get_cam_info(&info)) + { + QString to_print; + + // display caminfo + to_print = QString::number(info.res_x)+"x"+QString::number(info.res_y)+" @ "+QString::number(info.fps)+" FPS"; + ui.caminfo_label->setText(to_print); + + // display pointinfo + int n_points = tracker->get_n_points(); + to_print = QString::number(n_points); + if (n_points == 3) + to_print += " OK!"; + else + to_print += " BAD!"; + ui.pointinfo_label->setText(to_print); + + // update calibration + if (trans_calib_running) trans_calib_step(); + } + else + { + ui.caminfo_label->setText("Tracker offline"); + ui.pointinfo_label->setText(""); + } +} + +void OptionsDialog::trans_calib_step() +{ + auto tracker = get_pt(); + if (tracker) + { + Affine X_CM = tracker->pose(); + trans_calib.update(X_CM.R, X_CM.t); + } +} + +Tracker_PT* OptionsDialog::get_pt() +{ + auto work = state.work.get(); + if (!work) + return nullptr; + auto ptr = work->libs.pTracker; + if (ptr) + return static_cast<Tracker_PT*>(ptr.get()); + return nullptr; +} + +void OptionsDialog::update_rot_display(int value) +{ + ui.rot_gain->setText(QString::number((value + 1) * 10 / 100.) + "°"); +} + +void OptionsDialog::update_trans_display(int value) +{ + ui.trans_gain->setText(QString::number((value + 1) * 5 / 100.) + "mm"); +} + +void OptionsDialog::update_ewma_display(int value) +{ + ui.ewma_label->setText(QString::number(value * 2) + "ms"); +} + +void OptionsDialog::update_rot_dz_display(int value) +{ + ui.rot_dz->setText(QString::number(value * 2 / 100.) + "°"); +} + +void OptionsDialog::update_trans_dz_display(int value) +{ + ui.trans_dz->setText(QString::number(value * 1 / 100.) + "mm"); +} diff --git a/facetracknoir/options-dialog.hpp b/facetracknoir/options-dialog.hpp index 3ef99d06..8e71bd40 100644 --- a/facetracknoir/options-dialog.hpp +++ b/facetracknoir/options-dialog.hpp @@ -2,8 +2,14 @@ #include <QObject> #include <QWidget> +#include <QTimer> #include "ui_settings.h" +#include "opentrack/state.hpp" #include "opentrack/shortcuts.h" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h" +#include "facetracknoir/trans_calib.h" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt.h" +#include "ftnoir_filter_accela/ftnoir_filter_accela.h" class OptionsDialog: public QWidget { @@ -11,13 +17,30 @@ class OptionsDialog: public QWidget signals: void reload(); public: - OptionsDialog(); + OptionsDialog(State &state); private: Ui::UI_Settings ui; Shortcuts::settings s; + settings_pt pt; + settings_accela acc; + QTimer timer; + State& state; + TranslationCalibrator trans_calib; + bool trans_calib_running; + + Tracker_PT* get_pt(); void closeEvent(QCloseEvent *) override { doCancel(); } private slots: + void update_ewma_display(int value); + void update_rot_display(int value); + void update_trans_display(int value); + void update_rot_dz_display(int value); + void update_trans_dz_display(int value); + void doOK(); void doCancel(); + void startstop_trans_calib(bool start); + void poll_tracker_info(); + void trans_calib_step(); void bind_key(value<QString>& ret, QLabel* label); }; diff --git a/facetracknoir/settings.ui b/facetracknoir/settings.ui index 5eea9e57..9c2e4706 100644 --- a/facetracknoir/settings.ui +++ b/facetracknoir/settings.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>348</width> - <height>548</height> + <width>462</width> + <height>689</height> </rect> </property> <property name="windowTitle"> @@ -173,8 +173,240 @@ <attribute name="title"> <string>Camera</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> + <layout class="QGridLayout" name="gridLayout_9"> + <item row="3" column="0"> + <widget class="QGroupBox" name="groupBox_6"> + <property name="title"> + <string>Point extraction</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QFrame" name="frame_2"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_10"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Threshold</string> + </property> + <property name="buddy"> + <cstring>threshold_slider</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSlider" name="threshold_slider"> + <property name="toolTip"> + <string>Intensity threshold for point extraction</string> + </property> + <property name="maximum"> + <number>255</number> + </property> + <property name="pageStep"> + <number>1</number> + </property> + <property name="value"> + <number>127</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>25</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> + <widget class="QLabel" name="label_29"> + <property name="text"> + <string>Min size</string> + </property> + <property name="buddy"> + <cstring>mindiam_spin</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="mindiam_spin"> + <property name="toolTip"> + <string>Minimum point diameter</string> + </property> + <property name="suffix"> + <string> px</string> + </property> + <property name="maximum"> + <number>1024</number> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="label_22"> + <property name="text"> + <string>Max size</string> + </property> + <property name="buddy"> + <cstring>maxdiam_spin</cstring> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QSpinBox" name="maxdiam_spin"> + <property name="toolTip"> + <string>Maximum point diameter</string> + </property> + <property name="suffix"> + <string> px</string> + </property> + <property name="maximum"> + <number>1024</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item row="4" column="0"> + <widget class="QGroupBox" name="groupBox_11"> + <property name="title"> + <string>Status</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="caminfo_label"> + <property name="text"> + <string>Not running</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="pointinfo_label"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="QGroupBox" name="groupBox_9"> + <property name="title"> + <string>Device</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="2" column="0"> + <widget class="QLabel" name="label_32"> + <property name="text"> + <string>Dynamic pose resolution</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QCheckBox" name="dynamic_pose"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="camera_mode"> + <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_25"> + <property name="text"> + <string>Mode</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> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Field of view</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_33"> + <property name="text"> + <string>Dynamic pose timeout</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QSpinBox" name="init_phase_timeout"> + <property name="suffix"> + <string> ms</string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>10000</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="0"> <widget class="QGroupBox" name="groupBox_5"> <property name="title"> <string>Camera offset</string> @@ -280,202 +512,374 @@ </layout> </widget> </item> + <item row="5" column="0"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_2"> + <attribute name="title"> + <string>Model</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_6"> <item> - <widget class="QGroupBox" name="groupBox_6"> + <widget class="QGroupBox" name="groupBox_7"> + <property name="styleSheet"> + <string notr="true">QGroupBox { border: 0; }</string> + </property> <property name="title"> - <string>Center pose offset</string> + <string/> </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QLabel" name="label_22"> - <property name="text"> - <string>Alter the centered position sent to games by a fixed amount.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="margin"> - <number>2</number> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_7"> + <widget class="QFrame" name="frame_5"> <property name="styleSheet"> - <string notr="true">QGroupBox { - border: 0; -}</string> - </property> - <property name="title"> - <string/> + <string notr="true">QFrame { border: 0; }</string> </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> </property> - <property name="flat"> - <bool>false</bool> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> - <property name="checkable"> - <bool>false</bool> + <property name="lineWidth"> + <number>0</number> </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="2" column="1"> - <widget class="QDoubleSpinBox" name="pos_rz"> - <property name="suffix"> - <string> deg.</string> + <layout class="QGridLayout" name="gridLayout_16"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>40</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_4"> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> </property> - <property name="decimals"> - <number>3</number> + <property name="text"> + <string>Hat</string> </property> - <property name="minimum"> - <double>-180.000000000000000</double> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximum"> - <double>180.000000000000000</double> + <property name="minimumSize"> + <size> + <width>120</width> + <height>108</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>120</width> + <height>108</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-hat.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> </property> </widget> </item> - <item row="2" column="3"> - <widget class="QDoubleSpinBox" name="pos_tz"> - <property name="suffix"> - <string> cm</string> + <item row="1" column="1"> + <widget class="QLabel" name="label_34"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="decimals"> - <number>3</number> + <property name="minimumSize"> + <size> + <width>130</width> + <height>130</height> + </size> </property> - <property name="minimum"> - <double>-100.000000000000000</double> + <property name="maximumSize"> + <size> + <width>130</width> + <height>130</height> + </size> </property> - <property name="maximum"> - <double>100.000000000000000</double> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-clip-right.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QLabel" name="label_4"> + <item row="1" column="0"> + <widget class="QLabel" name="label_35"> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> + </property> <property name="text"> - <string>TX</string> + <string>Right-handed clip</string> </property> </widget> </item> - <item row="0" column="3"> - <widget class="QDoubleSpinBox" name="pos_tx"> - <property name="suffix"> - <string> cm</string> + <item row="2" column="1"> + <widget class="QLabel" name="label_36"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="decimals"> - <number>3</number> + <property name="minimumSize"> + <size> + <width>130</width> + <height>130</height> + </size> </property> - <property name="minimum"> - <double>-100.000000000000000</double> + <property name="maximumSize"> + <size> + <width>130</width> + <height>130</height> + </size> </property> - <property name="maximum"> - <double>100.000000000000000</double> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-clip-left.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label"> + <item row="2" column="0"> + <widget class="QLabel" name="label_37"> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> + </property> + <property name="text"> + <string>Left-handed clip</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame_6"> + <property name="styleSheet"> + <string notr="true">QFrame { border: 0; }</string> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="lineWidth"> + <number>0</number> + </property> + <layout class="QGridLayout" name="gridLayout_17"> + <property name="leftMargin"> + <number>31</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_31"> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> + </property> <property name="text"> - <string>RY</string> + <string>Model used</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QLabel" name="label_5"> + <item row="0" column="1"> + <widget class="QComboBox" name="model_used"> + <item> + <property name="text"> + <string>Cap</string> + </property> + </item> + <item> + <property name="text"> + <string>Clip</string> + </property> + </item> + <item> + <property name="text"> + <string>Clip left-handed</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Model position calibration</string> + </property> + <layout class="QGridLayout" name="gridLayout_11"> + <item row="0" column="0"> + <widget class="QFrame" name="frame_3"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_12"> + <item row="0" column="0"> + <widget class="QLabel" name="label_61"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string>TY</string> + <string>x:</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QDoubleSpinBox" name="pos_ry"> + <item row="0" column="1"> + <widget class="QSpinBox" name="tx_spin"> <property name="suffix"> - <string> deg.</string> - </property> - <property name="decimals"> - <number>3</number> + <string> mm</string> </property> <property name="minimum"> - <double>-180.000000000000000</double> + <number>-65535</number> </property> <property name="maximum"> - <double>180.000000000000000</double> + <number>65536</number> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>TZ</string> + <item row="1" column="0"> + <widget class="QLabel" name="label_62"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> <property name="text"> - <string>RZ</string> + <string>y:</string> </property> </widget> </item> - <item row="1" column="3"> - <widget class="QDoubleSpinBox" name="pos_ty"> + <item row="1" column="1"> + <widget class="QSpinBox" name="ty_spin"> <property name="suffix"> - <string> cm</string> - </property> - <property name="decimals"> - <number>3</number> + <string> mm</string> </property> <property name="minimum"> - <double>-100.000000000000000</double> + <number>-65535</number> </property> <property name="maximum"> - <double>100.000000000000000</double> + <number>65536</number> </property> </widget> </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_2"> + <item row="2" column="0"> + <widget class="QLabel" name="label_66"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string>RX</string> + <string>z:</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QDoubleSpinBox" name="pos_rx"> + <item row="2" column="1"> + <widget class="QSpinBox" name="tz_spin"> <property name="suffix"> - <string> deg.</string> - </property> - <property name="decimals"> - <number>3</number> + <string> mm</string> </property> <property name="minimum"> - <double>-180.000000000000000</double> + <number>-65535</number> </property> <property name="maximum"> - <double>180.000000000000000</double> + <number>65536</number> </property> </widget> </item> </layout> </widget> </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_59"> + <property name="text"> + <string><html><head/><body><p>Only pitch and yaw during calibration.</p><p>Don't roll and don't translate.</p></body></html></string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QPushButton" name="tcalib_button"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Toggle calibration</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> </layout> </widget> <widget class="QWidget" name="tab_4"> @@ -975,6 +1379,257 @@ </item> </layout> </widget> + <widget class="QWidget" name="tab_6"> + <attribute name="title"> + <string>Filter</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_15"> + <item row="0" column="0"> + <widget class="QFrame" name="frame_4"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_14"> + <item row="1" column="3"> + <widget class="QSlider" name="rotation_slider"> + <property name="maximum"> + <number>99</number> + </property> + <property name="pageStep"> + <number>5</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>25</number> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="lblSensYaw_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Rotation sensitivity</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>Smoothing</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="ewma_label"> + <property name="minimumSize"> + <size> + <width>48</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>0 ms</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="rot_gain"> + <property name="text"> + <string>0°</string> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QSlider" name="ewma_slider"> + <property name="maximum"> + <number>100</number> + </property> + <property name="singleStep"> + <number>10</number> + </property> + <property name="pageStep"> + <number>25</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>25</number> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_27"> + <property name="text"> + <string>Translation deadzone</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_28"> + <property name="text"> + <string>Rotation deadzone</string> + </property> + </widget> + </item> + <item row="4" column="3"> + <widget class="QSlider" name="rot_dz_slider"> + <property name="maximum"> + <number>100</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="rot_dz"> + <property name="text"> + <string>0°</string> + </property> + </widget> + </item> + <item row="6" column="3"> + <widget class="QSlider" name="trans_dz_slider"> + <property name="maximum"> + <number>100</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="trans_dz"> + <property name="text"> + <string>0mm</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_30"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Translation sensitivity</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="trans_gain"> + <property name="text"> + <string>0mm</string> + </property> + </widget> + </item> + <item row="5" column="3"> + <widget class="QSlider" name="translation_slider"> + <property name="maximum"> + <number>99</number> + </property> + <property name="pageStep"> + <number>5</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>25</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="QGroupBox" name="groupBox_12"> + <property name="title"> + <string>GroupBox</string> + </property> + <layout class="QGridLayout" name="gridLayout_13"> + <item row="0" column="1"> + <widget class="QLabel" name="label_26"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string><html><head/><body><p align="justify"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2015</span></p><p align="right"><br/></p></body></html></string> + </property> + <property name="textFormat"> + <enum>Qt::RichText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="indent"> + <number>0</number> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string><html><head/><body><p>Visit <a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" text-decoration: underline; color:#0000ff;">our wiki</span></a> for description of the settings.</p></body></html></string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> <widget class="QWidget" name="tab_5"> <attribute name="title"> <string>Game detection</string> @@ -1035,12 +1690,6 @@ <tabstop>camera_yaw</tabstop> <tabstop>camera_pitch</tabstop> <tabstop>camera_roll</tabstop> - <tabstop>pos_rx</tabstop> - <tabstop>pos_ry</tabstop> - <tabstop>pos_rz</tabstop> - <tabstop>pos_tx</tabstop> - <tabstop>pos_ty</tabstop> - <tabstop>pos_tz</tabstop> <tabstop>tcomp_enable</tabstop> <tabstop>tcomp_rz</tabstop> <tabstop>src_yaw</tabstop> @@ -1056,8 +1705,27 @@ <tabstop>src_z</tabstop> <tabstop>invert_z</tabstop> </tabstops> - <resources/> + <resources> + <include location="ui-res.qrc"/> + </resources> <connections/> + <designerdata> + <property name="gridDeltaX"> + <number>5</number> + </property> + <property name="gridDeltaY"> + <number>5</number> + </property> + <property name="gridSnapX"> + <bool>true</bool> + </property> + <property name="gridSnapY"> + <bool>true</bool> + </property> + <property name="gridVisible"> + <bool>true</bool> + </property> + </designerdata> <slots> <slot>startEngineClicked()</slot> <slot>stopEngineClicked()</slot> diff --git a/facetracknoir/trackhat-wizard.ui b/facetracknoir/trackhat-wizard.ui new file mode 100644 index 00000000..09f68c03 --- /dev/null +++ b/facetracknoir/trackhat-wizard.ui @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>wizard</class> + <widget class="QWizard" name="wizard"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>365</width> + <height>586</height> + </rect> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <property name="wizardStyle"> + <enum>QWizard::AeroStyle</enum> + </property> + <property name="options"> + <set>QWizard::NoCancelButton</set> + </property> + <widget class="QWizardPage" name="page_model"> + <property name="title"> + <string>Select a model</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QFrame" name="frame_7"> + <property name="styleSheet"> + <string notr="true">QFrame { + border: 0; + background: transparent; +}</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="bottomMargin"> + <number>12</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="1"> + <widget class="QLabel" name="label_12"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>120</width> + <height>108</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>120</width> + <height>108</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-hat.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_46"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>130</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>130</width> + <height>130</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-clip-right.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_48"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>130</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>130</width> + <height>130</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ui-res.qrc">:/images/trackhat-clip-left.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QRadioButton" name="cap_model"> + <property name="text"> + <string>Cap</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QRadioButton" name="clip_model"> + <property name="text"> + <string>Clip, right-handed</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QRadioButton" name="clip_model_left"> + <property name="text"> + <string>Clip, left-handed</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWizardPage" name="page_done"> + <property name="title"> + <string>We're all done!</string> + </property> + <layout class="QGridLayout" name="gridLayout_7"> + <item row="0" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string><html><head/><body><p>You can now use your new hardware and thanks for flying TrackHat.</p></body></html></string> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <resources> + <include location="ui-res.qrc"/> + </resources> + <connections/> +</ui> diff --git a/facetracknoir/trans_calib.cpp b/facetracknoir/trans_calib.cpp new file mode 100644 index 00000000..a1a4b641 --- /dev/null +++ b/facetracknoir/trans_calib.cpp @@ -0,0 +1,41 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "trans_calib.h" + +TranslationCalibrator::TranslationCalibrator() +{ + reset(); +} + +void TranslationCalibrator::reset() +{ + P = cv::Matx66f::zeros(); + y = cv::Vec6f(0,0,0, 0,0,0); +} + +void TranslationCalibrator::update(const cv::Matx33f& R_CM_k, const cv::Vec3f& t_CM_k) +{ + cv::Matx<float, 6,3> H_k_T = cv::Matx<float, 6,3>::zeros(); + for (int i=0; i<3; ++i) { + for (int j=0; j<3; ++j) { + H_k_T(i,j) = R_CM_k(j,i); + } + } + for (int i=0; i<3; ++i) + { + H_k_T(3+i,i) = 1.0; + } + P += H_k_T * H_k_T.t(); + y += H_k_T * t_CM_k; +} + +cv::Vec3f TranslationCalibrator::get_estimate() +{ + cv::Vec6f x = P.inv() * y; + return cv::Vec3f(-x[0], -x[1], -x[2]); +} diff --git a/facetracknoir/trans_calib.h b/facetracknoir/trans_calib.h new file mode 100644 index 00000000..e20fc767 --- /dev/null +++ b/facetracknoir/trans_calib.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef TRANSCALIB_H +#define TRANSCALIB_H + +#include <opencv2/core/core.hpp> + +//----------------------------------------------------------------------------- +// Calibrates the translation from head to model = t_MH +// by recursive least squares / +// kalman filter in information form with identity noise covariance +// measurement equation when head position = t_CH is fixed: +// (R_CM_k , Id)*(-t_MH, t_CH) = t_CM_k + +class TranslationCalibrator +{ +public: + TranslationCalibrator(); + + // reset the calibration process + void reset(); + + // update the current estimate + void update(const cv::Matx33f& R_CM_k, const cv::Vec3f& t_CM_k); + + // get the current estimate for t_MH + cv::Vec3f get_estimate(); + +private: + cv::Matx66f P; // normalized precision matrix = inverse covariance + cv::Vec6f y; // P*(-t_MH, t_CH) +}; + +#endif //TRANSCALIB_H diff --git a/facetracknoir/ui-res.qrc b/facetracknoir/ui-res.qrc index 030a6153..ec1c7bba 100644 --- a/facetracknoir/ui-res.qrc +++ b/facetracknoir/ui-res.qrc @@ -6,5 +6,8 @@ <file>images/facetracknoir.png</file> <file>images/no-feed.png</file> <file>images/filter-16.png</file> + <file>images/trackhat-clip-left.png</file> + <file>images/trackhat-clip-right.png</file> + <file>images/trackhat-hat.png</file> </qresource> </RCC> diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 698d4a1a..4f1d8c18 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -33,6 +33,8 @@ #include "ui.h" #include "opentrack/tracker.h" #include "opentrack/options.hpp" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt.h" +#include "ftnoir_filter_accela/ftnoir_filter_accela.h" #include <QFileDialog> #include <QFileInfo> @@ -60,26 +62,14 @@ MainWindow::MainWindow() : connect(ui.btnEditCurves, SIGNAL(clicked()), this, SLOT(showCurveConfiguration())); connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(showKeyboardShortcuts())); - connect(ui.btnShowEngineControls, SIGNAL(clicked()), this, SLOT(showTrackerSettings())); connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showProtocolSettings())); - connect(ui.btnShowFilterControls, SIGNAL(clicked()), this, SLOT(showFilterSettings())); - - modules.filters().push_front(std::make_shared<dylib>("", dylib::Filter)); - - for (auto x : modules.trackers()) - ui.iconcomboTrackerSource->addItem(x->icon, x->name); for (auto x : modules.protocols()) ui.iconcomboProtocol->addItem(x->icon, x->name); - for (auto x : modules.filters()) - ui.iconcomboFilter->addItem(x->icon, x->name); - fill_profile_combobox(); - tie_setting(s.tracker_dll, ui.iconcomboTrackerSource); tie_setting(s.protocol_dll, ui.iconcomboProtocol); - tie_setting(s.filter_dll, ui.iconcomboFilter); connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker())); @@ -205,8 +195,6 @@ void MainWindow::updateButtonState(bool running, bool inertialp) ui.btnStartTracker->setEnabled ( not_running ); ui.btnStopTracker->setEnabled ( running ); ui.iconcomboProtocol->setEnabled ( not_running ); - ui.iconcomboFilter->setEnabled ( not_running ); - ui.iconcomboTrackerSource->setEnabled(not_running); ui.video_frame_label->setVisible(not_running || inertialp); ui.btnSaveAs->setEnabled(not_running); ui.btnLoad->setEnabled(not_running); @@ -226,7 +214,7 @@ void MainWindow::startTracker() { // tracker dtor needs run first work = nullptr; - libs = SelectedLibraries(ui.video_frame, current_tracker(), current_protocol(), current_filter()); + libs = SelectedLibraries(ui.video_frame, std::make_shared<Tracker_PT>(), current_protocol(), std::make_shared<FTNoIR_Filter>()); { double p[6] = {0,0,0, 0,0,0}; @@ -247,12 +235,6 @@ void MainWindow::startTracker() { bindKeyboardShortcuts(); - if (pTrackerDialog) - pTrackerDialog->register_tracker(libs.pTracker.get()); - - if (pFilterDialog) - pFilterDialog->register_filter(libs.pFilter.get()); - if (pProtocolDialog) pProtocolDialog->register_protocol(libs.pProtocol.get()); @@ -270,24 +252,12 @@ void MainWindow::stopTracker( ) { pose_update_timer.stop(); ui.pose_display->rotateBy(0, 0, 0, 0, 0, 0); - if (pTrackerDialog) - { - pTrackerDialog->unregister_tracker(); - pTrackerDialog = nullptr; - } - if (pProtocolDialog) { pProtocolDialog->unregister_protocol(); pProtocolDialog = nullptr; } - if (pFilterDialog) - { - pFilterDialog->unregister_filter(); - pFilterDialog = nullptr; - } - work = nullptr; libs = SelectedLibraries(); @@ -342,7 +312,7 @@ void MainWindow::set_title(const QString& game_title_) if (game_title_ != "") game_title = " :: " + game_title_; QString current = QFileInfo(group::ini_pathname()).fileName(); - setWindowTitle(const_cast<const char*>(opentrack_version) + QStringLiteral(" :: ") + current + game_title); + setWindowTitle(QStringLiteral("TrackHat ") + const_cast<const char*>(opentrack_version) + QStringLiteral(" :: ") + current + game_title); } void MainWindow::showHeadPose() @@ -363,12 +333,12 @@ void MainWindow::showHeadPose() } template<typename t> -bool mk_dialog(mem<dylib> lib, mem<t>& orig) +bool mk_dialog(mem<dylib> lib, mem<t>* orig) { - if (orig && orig->isVisible()) + if (*orig && (*orig)->isVisible()) { - orig->show(); - orig->raise(); + (*orig)->show(); + (*orig)->raise(); return false; } @@ -378,34 +348,19 @@ bool mk_dialog(mem<dylib> lib, mem<t>& orig) dialog->setWindowFlags(Qt::Dialog); dialog->setFixedSize(dialog->size()); - orig = dialog; + *orig = dialog; dialog->show(); dialog->raise(); - QObject::connect(dialog.get(), &BaseDialog::closing, [&]() -> void { orig = nullptr; }); - return true; } return false; } - -void MainWindow::showTrackerSettings() -{ - if (mk_dialog(current_tracker(), pTrackerDialog) && libs.pTracker) - pTrackerDialog->register_tracker(libs.pTracker.get()); -} - void MainWindow::showProtocolSettings() { - if (mk_dialog(current_protocol(), pProtocolDialog) && libs.pProtocol) + if (mk_dialog(current_protocol(), &pProtocolDialog) && libs.pProtocol) pProtocolDialog->register_protocol(libs.pProtocol.get()); } - -void MainWindow::showFilterSettings() { - if (mk_dialog(current_filter(), pFilterDialog) && libs.pFilter) - pFilterDialog->register_filter(libs.pFilter.get()); -} - template<typename t, typename... Args> bool mk_window(mem<t>* place, Args... params) { @@ -426,7 +381,7 @@ bool mk_window(mem<t>* place, Args... params) } void MainWindow::showKeyboardShortcuts() { - if (mk_window(&shortcuts_widget)) + if (mk_window<OptionsDialog, State&>(&shortcuts_widget, *this)) connect(shortcuts_widget.get(), SIGNAL(reload()), this, SLOT(bindKeyboardShortcuts())); } diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h index 097b2439..2253ec80 100644 --- a/facetracknoir/ui.h +++ b/facetracknoir/ui.h @@ -73,23 +73,13 @@ class MainWindow : public QMainWindow, private State mem<MapWidget> mapping_widget; QShortcut kbd_quit; QPixmap no_feed_pixmap; - mem<IFilterDialog> pFilterDialog; mem<IProtocolDialog> pProtocolDialog; - mem<ITrackerDialog> pTrackerDialog; process_detector_worker det; - mem<dylib> current_tracker() - { - return modules.trackers().value(ui.iconcomboTrackerSource->currentIndex(), nullptr); - } mem<dylib> current_protocol() { return modules.protocols().value(ui.iconcomboProtocol->currentIndex(), nullptr); } - mem<dylib> current_filter() - { - return modules.filters().value(ui.iconcomboFilter->currentIndex(), nullptr); - } void changeEvent(QEvent* e) override; @@ -112,9 +102,7 @@ private slots: void exit(); void profileSelected(int index); - void showTrackerSettings(); void showProtocolSettings(); - void showFilterSettings(); void showKeyboardShortcuts(); void showCurveConfiguration(); void showHeadPose(); diff --git a/facetracknoir/wizard.cpp b/facetracknoir/wizard.cpp new file mode 100644 index 00000000..bc90176a --- /dev/null +++ b/facetracknoir/wizard.cpp @@ -0,0 +1,87 @@ +#include "wizard.h" +#include "opentrack/state.hpp" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h" +#include "ftnoir_filter_accela/ftnoir_filter_accela.h" + +Wizard::Wizard() : QWizard(nullptr) +{ + ui.setupUi(this); + connect(this, SIGNAL(accepted()), this, SLOT(set_data())); +} + +static constexpr double tz[][2] = { + { 16.5327205657959, 13.0232553482056 }, + { 55.4535026550293, 100 }, + { 56.8312301635742, 100 }, + { -1, -1 }, +}; + +static constexpr double yaw[][2] = { + { 10.7462686567164, 20.9302325581395 }, + { 41.9517784118652, 180 }, + { -1, -1 }, +}; + +static constexpr double pitch[][2] = { + { 10.1262916188289, 27.6279069767442 }, + { 32.4454649827784, 180 }, + { -1, -1 }, +}; + +static constexpr double roll[][2] = { + { 12.3995409011841, 25.9534893035889 }, + { 54.3513221740723, 180 }, + { -1, -1 }, +}; + +static void set_mapping(Mapping& m, const double spline[][2]) +{ + m.opts.altp = false; + m.curve.removeAllPoints(); + for (int i = 0; spline[i][0] >= 0; i++) + m.curve.addPoint(QPointF(spline[i][0], spline[i][1])); +} + +void Wizard::set_data() +{ + Model m; + + if (ui.clip_model->isChecked()) + m = ClipRight; + else if (ui.clip_model_left->isChecked()) + m = ClipLeft; + else // ui.cap_model + m = Cap; + + 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(); + + settings_pt pt; + switch (m) + { + default: + case Cap: pt.t_MH_x = 0; pt.t_MH_y = 0; pt.t_MH_z = 0; break; + 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.threshold = 31; + pt.min_point_size = 2; + pt.max_point_size = 50; + pt.fov = 1; + pt.camera_mode = 0; + pt.model_used = m; + pt.b->save(); + + settings_accela acc; + acc.ewma = 49; + acc.rot_threshold = 29; + acc.rot_deadzone = 29; + acc.trans_deadzone = 33; + acc.trans_threshold = 19; + acc.b->save(); +} diff --git a/facetracknoir/wizard.h b/facetracknoir/wizard.h new file mode 100644 index 00000000..ea848e36 --- /dev/null +++ b/facetracknoir/wizard.h @@ -0,0 +1,21 @@ +#pragma once + +#include "opentrack/options.hpp" +#include "opentrack/main-settings.hpp" +#include "opentrack/mappings.hpp" +#include "ui_trackhat-wizard.h" +#include <QObject> +#include <QWizard> + +class Wizard : public QWizard +{ + Q_OBJECT + Ui_wizard ui; +public: + Wizard(); + + enum Model { Cap = 0, ClipRight = 1, ClipLeft = 2 }; + enum { ClipRightX = 135, ClipLeftX = -135 }; +private slots: + void set_data(); +}; |