diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-01-29 12:58:57 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-01-29 12:58:57 +0000 |
commit | 51a3eb679889844a0f8c8643034615dc12a7f523 (patch) | |
tree | a93e97b35e06ef476c80375275ba190ab8d57741 | |
parent | de8ca77801f1f7de1e553967f80147ad89345912 (diff) |
Testing filter.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@45 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r-- | FTNoIR_Filter_EWMA2/ftnoir_filter_base.h | 2 | ||||
-rw-r--r-- | FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp | 33 | ||||
-rw-r--r-- | FTNoIR_Tracker_UDP/ftnoir_tracker_base.h | 2 | ||||
-rw-r--r-- | FTNoIR_Tracker_UDP/ftnoir_tracker_udp.cpp | 18 | ||||
-rw-r--r-- | FaceTrackNoIR.suo | bin | 325632 -> 333824 bytes | |||
-rw-r--r-- | FaceTrackNoIR/FGServer.cpp | 6 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.cpp | 77 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.ui | 4 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.vcproj | 95 | ||||
-rw-r--r-- | FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest | 5 | ||||
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 22 | ||||
-rw-r--r-- | FaceTrackNoIR/tracker.h | 1 | ||||
-rw-r--r-- | bin/FaceTrackNoIR.exe | bin | 737280 -> 757760 bytes | |||
-rw-r--r-- | bin/Settings/SimConnect.ini | 30 | ||||
-rw-r--r-- | bin/image6.0.dll | bin | 1282048 -> 1282048 bytes |
15 files changed, 222 insertions, 73 deletions
diff --git a/FTNoIR_Filter_EWMA2/ftnoir_filter_base.h b/FTNoIR_Filter_EWMA2/ftnoir_filter_base.h index f05fe66a..dd8c7582 100644 --- a/FTNoIR_Filter_EWMA2/ftnoir_filter_base.h +++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_base.h @@ -15,7 +15,7 @@ struct IFilter {
virtual void Release() = 0;
virtual void Initialize() = 0;
- virtual void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position) = 0;
+ virtual void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) = 0;
virtual void getFilterFullName(QString *strToBeFilled) = 0;
virtual void getFilterShortName(QString *strToBeFilled) = 0;
diff --git a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp index d982406a..c298c6e8 100644 --- a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp +++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp @@ -1,5 +1,6 @@ #include "ftnoir_filter_base.h"
#include "math.h"
+#include <QDebug>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -15,7 +16,7 @@ public: void Release();
void Initialize();
void StartFilter();
- void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position);
+ void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget);
void getFilterFullName(QString *strToBeFilled);
void getFilterShortName(QString *strToBeFilled);
@@ -30,6 +31,8 @@ private: float smoothing_frames_range;
float alpha_smoothing;
float prev_alpha[6];
+ float alpha[6];
+ float smoothed_alpha[6];
//parameter list for the filter-function(s)
enum
@@ -74,7 +77,7 @@ FTNoIR_Filter_EWMA2::FTNoIR_Filter_EWMA2() parameterSteps.append(1.0f);
parameterValueAsFloat.append(0.0f);
parameterValueAsString.append("");
- setParameterValue(kMinSmoothing,2.0f);
+ setParameterValue(kMinSmoothing,10.0f);
parameterNameAsString.append("MaxSmoothing");
parameterUnitsAsString.append("Frames");
@@ -82,7 +85,7 @@ FTNoIR_Filter_EWMA2::FTNoIR_Filter_EWMA2() parameterSteps.append(1.0f);
parameterValueAsFloat.append(0.0f);
parameterValueAsString.append("");
- setParameterValue(kMaxSmoothing,10.0f);
+ setParameterValue(kMaxSmoothing,50.0f);
parameterNameAsString.append("SmoothingScaleCurve");
parameterUnitsAsString.append("Power");
@@ -93,7 +96,7 @@ FTNoIR_Filter_EWMA2::FTNoIR_Filter_EWMA2() setParameterValue(kSmoothingScaleCurve,10.0f);
first_run = true;
- alpha_smoothing = 0.1f; //this is a constant for now, might be a parameter later
+ alpha_smoothing = 0.2f; //this is a constant for now, might be a parameter later
}
@@ -112,16 +115,14 @@ void FTNoIR_Filter_EWMA2::Initialize() return;
}
-void FTNoIR_Filter_EWMA2::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position)
+void FTNoIR_Filter_EWMA2::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget)
{
//non-optimised version for clarity
float prev_output[6];
float target[6];
float output_delta[6];
- float scale[]={0.25f,0.25f,0.25f,6.0f,6.0f,6.0f};
+ float scale[]={0.05f,0.05f,0.05f,1.2f,1.2f,1.2f};
float norm_output_delta[6];
- float alpha[6];
- float smoothed_alpha[6];
float output[6];
int i=0;
@@ -185,12 +186,17 @@ void FTNoIR_Filter_EWMA2::FilterHeadPoseData(THeadPoseData *current_camera_posit //calculate the alphas
//work out the dynamic smoothing factors
- for (i=0;i<6;i++)
- {
- alpha[i]=1.0f/(parameterValueAsFloat[kMinSmoothing]+((1.0f-pow(norm_output_delta[i],parameterValueAsFloat[kSmoothingScaleCurve]))*smoothing_frames_range));
- smoothed_alpha[i]=(alpha_smoothing*alpha[i])+((1.0f-alpha_smoothing)*prev_alpha[i]);
+ if (newTarget) {
+ for (i=0;i<6;i++)
+ {
+ alpha[i]=1.0f/(parameterValueAsFloat[kMinSmoothing]+((1.0f-pow(norm_output_delta[i],parameterValueAsFloat[kSmoothingScaleCurve]))*smoothing_frames_range));
+ smoothed_alpha[i]=(alpha_smoothing*alpha[i])+((1.0f-alpha_smoothing)*prev_alpha[i]);
+ }
}
+ qDebug() << "FTNoIR_Filter_EWMA2::FilterHeadPoseData() smoothing frames = " << smoothing_frames_range;
+ qDebug() << "FTNoIR_Filter_EWMA2::FilterHeadPoseData() alpha[3] = " << alpha[3];
+
//use the same (largest) smoothed alpha for each channel
//NB: larger alpha = *less* lag (opposite to what you'd expect)
float largest_alpha=0.0f;
@@ -205,7 +211,8 @@ void FTNoIR_Filter_EWMA2::FilterHeadPoseData(THeadPoseData *current_camera_posit //move the camera
for (i=0;i<6;i++)
{
- output[i]=(largest_alpha*target[i])+((1.0f-largest_alpha)*prev_output[i]);
+// output[i]=(largest_alpha*target[i])+((1.0f-largest_alpha)*prev_output[i]);
+ output[i]=(smoothed_alpha[i]*target[i])+((1.0f-smoothed_alpha[i])*prev_output[i]);
}
new_camera_position->x=output[0];
diff --git a/FTNoIR_Tracker_UDP/ftnoir_tracker_base.h b/FTNoIR_Tracker_UDP/ftnoir_tracker_base.h index ac4b2956..60f0caf3 100644 --- a/FTNoIR_Tracker_UDP/ftnoir_tracker_base.h +++ b/FTNoIR_Tracker_UDP/ftnoir_tracker_base.h @@ -36,7 +36,7 @@ typedef ITracker* TRACKERHANDLE; # define EXTERN_C
#endif // __cplusplus
-// Factory function that creates instances of the Xyz object.
+// Factory function that creates instances of the Tracker object.
EXTERN_C
FTNOIR_TRACKER_BASE_EXPORT
TRACKERHANDLE
diff --git a/FTNoIR_Tracker_UDP/ftnoir_tracker_udp.cpp b/FTNoIR_Tracker_UDP/ftnoir_tracker_udp.cpp index eaa0b177..d3c67d71 100644 --- a/FTNoIR_Tracker_UDP/ftnoir_tracker_udp.cpp +++ b/FTNoIR_Tracker_UDP/ftnoir_tracker_udp.cpp @@ -65,14 +65,12 @@ FTNoIR_Tracker_UDP::~FTNoIR_Tracker_UDP() ::CloseHandle(m_WaitThread);
if (inSocket) {
- inSocket->disconnectFromHost();
- inSocket->waitForDisconnected();
+ inSocket->close();
delete inSocket;
}
if (outSocket) {
- outSocket->disconnectFromHost();
- outSocket->waitForDisconnected();
+ outSocket->close();
delete outSocket;
}
}
@@ -143,12 +141,12 @@ void FTNoIR_Tracker_UDP::StartTracker() void FTNoIR_Tracker_UDP::GiveHeadPoseData(THeadPoseData *data)
{
- newHeadPose.x += 1.0f;
- newHeadPose.y += 2.0f;
- newHeadPose.z += 3.0f;
- newHeadPose.yaw += 4.0f;
- newHeadPose.pitch += 5.0f;
- newHeadPose.roll += 6.0f;
+ //newHeadPose.x += 1.0f;
+ //newHeadPose.y += 2.0f;
+ //newHeadPose.z += 3.0f;
+ //newHeadPose.yaw += 4.0f;
+ //newHeadPose.pitch += 5.0f;
+ //newHeadPose.roll += 6.0f;
data->x = newHeadPose.x;
data->y = newHeadPose.y;
diff --git a/FaceTrackNoIR.suo b/FaceTrackNoIR.suo Binary files differindex 2969c4b5..ae97a5a6 100644 --- a/FaceTrackNoIR.suo +++ b/FaceTrackNoIR.suo diff --git a/FaceTrackNoIR/FGServer.cpp b/FaceTrackNoIR/FGServer.cpp index fa7b60d5..53cd68ff 100644 --- a/FaceTrackNoIR/FGServer.cpp +++ b/FaceTrackNoIR/FGServer.cpp @@ -46,10 +46,8 @@ FGServer::FGServer( Tracker *parent ) { /** destructor **/
FGServer::~FGServer() {
- inSocket->disconnectFromHost();
- inSocket->waitForDisconnected();
- outSocket->disconnectFromHost();
- outSocket->waitForDisconnected();
+ inSocket->close();
+ outSocket->close();
delete inSocket;
delete outSocket;
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index 8c678100..eda9b51b 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -31,6 +31,7 @@ #include "FSUIPCServer.h"
#include "FTIRServer.h"
#include "FGServer.h"
+#include "FTNServer.h"
using namespace sm::faceapi;
using namespace sm::faceapi::qt;
@@ -340,7 +341,8 @@ void FaceTrackNoIR::saveAs() // Get the new filename of the INI-file.
//
QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"),
- QCoreApplication::applicationDirPath() + "/Settings",
+ oldFile,
+// QCoreApplication::applicationDirPath() + "/Settings",
tr("Settings file (*.ini);;All Files (*)"));
if (!fileName.isEmpty()) {
@@ -368,8 +370,10 @@ void FaceTrackNoIR::saveAs() settings.setValue ("SettingsFile", fileName);
save();
- // Put the filename in the window-title
- setWindowTitle ( "FaceTrackNoIR (1.5) - " + newFileInfo.fileName() );
+ //
+ // Reload the settings, to get the GUI right again...
+ //
+ loadSettings();
}
}
@@ -424,9 +428,10 @@ void FaceTrackNoIR::loadSettings() { ui.chkInvertY->setChecked (iniFile.value ( "invertY", 0 ).toBool());
ui.chkInvertZ->setChecked (iniFile.value ( "invertZ", 0 ).toBool());
ui.chkUseEWMA->setChecked (iniFile.value ( "useEWMA", 1 ).toBool());
- ui.minSmooth->setValue (iniFile.value ( "minSmooth", 2 ).toInt());
+
+ ui.minSmooth->setValue (iniFile.value ( "minSmooth", 15 ).toInt());
+ ui.maxSmooth->setValue (iniFile.value ( "maxSmooth", 50 ).toInt());
ui.powCurve->setValue (iniFile.value ( "powCurve", 10 ).toInt());
- ui.maxSmooth->setValue (iniFile.value ( "maxSmooth", 10 ).toInt());
iniFile.endGroup ();
iniFile.beginGroup ( "GameProtocol" );
@@ -514,10 +519,19 @@ void FaceTrackNoIR::startTracker( ) { ui.btnStopTracker->setEnabled ( true );
// Engine controls
- ui.btnShowEngineControls->setEnabled ( true );
- ui.iconcomboBox->setEnabled ( false );
+ switch (ui.iconcomboTrackerSource->currentIndex()) {
+ case FT_SM_FACEAPI: // Face API
+ ui.btnShowEngineControls->setEnabled ( true ); // Active only when started!
+ break;
+ case FT_FTNOIR: // FTNoir server
+ ui.btnShowEngineControls->setEnabled ( false );
+ break;
+ default:
+ break;
+ }
// Enable/disable Protocol-server Settings
+ ui.iconcomboBox->setEnabled ( false );
ui.btnShowServerControls->setEnabled ( false );
//
@@ -577,6 +591,21 @@ void FaceTrackNoIR::stopTracker( ) { // Enable/disable Protocol-server Settings
ui.btnShowServerControls->setEnabled ( true );
+ // Engine controls
+ switch (ui.iconcomboTrackerSource->currentIndex()) {
+ case FT_SM_FACEAPI: // Face API
+ ui.btnShowEngineControls->setEnabled ( false ); // Active only when started!
+ break;
+ case FT_FTNOIR: // FTNoir server
+ ui.btnShowEngineControls->setEnabled ( true );
+ break;
+ default:
+ break;
+ }
+
+ //
+ // Stop the timer, so it won't go off again...
+ //
timMinimizeFTN->stop();
}
@@ -673,10 +702,27 @@ void FaceTrackNoIR::showHeadPoseWidget() { /** toggles Engine Controls Dialog **/
void FaceTrackNoIR::showEngineControls() {
- // Create if new
+ //
+ // Delete the existing QDialog
+ //
+ if (_engine_controls) {
+ delete _engine_controls;
+ _engine_controls = 0;
+ }
+
+ // Create new
if (!_engine_controls)
{
- _engine_controls = new EngineControls( tracker->getEngine(), true, false, this, Qt::Dialog );
+ switch (ui.iconcomboTrackerSource->currentIndex()) {
+ case FT_SM_FACEAPI: // Face API
+ _engine_controls = new EngineControls( tracker->getEngine(), true, false, this, Qt::Dialog );
+ break;
+ case FT_FTNOIR: // FTNoir server
+ break;
+ default:
+ break;
+ }
+
}
// Show if already created
@@ -702,11 +748,9 @@ void FaceTrackNoIR::showServerControls() { if (!_server_controls)
{
-
// Show the appropriate Protocol-server Settings
switch (ui.iconcomboBox->currentIndex()) {
case FREE_TRACK:
- case FTNOIR:
case SIMCONNECT:
break;
case PPJOY:
@@ -721,6 +765,9 @@ void FaceTrackNoIR::showServerControls() { case FLIGHTGEAR:
_server_controls = new FGControls( this, Qt::Dialog );
break;
+ case FTNOIR:
+ _server_controls = new FTNServerControls( this, Qt::Dialog );
+ break;
default:
break;
}
@@ -860,7 +907,6 @@ void FaceTrackNoIR::setIcon(int index) // Enable/disable Protocol-server Settings
switch (ui.iconcomboBox->currentIndex()) {
case FREE_TRACK:
- case FTNOIR:
case SIMCONNECT:
ui.btnShowServerControls->hide();
break;
@@ -868,6 +914,7 @@ void FaceTrackNoIR::setIcon(int index) case FSUIPC:
case TRACKIR:
case FLIGHTGEAR:
+ case FTNOIR:
ui.btnShowServerControls->show();
ui.btnShowServerControls->setEnabled ( true );
break;
@@ -904,11 +951,13 @@ void FaceTrackNoIR::trackingSourceSelected(int index) {
settingsDirty = true;
switch (ui.iconcomboTrackerSource->currentIndex()) {
- case 0: // Face API
+ case FT_SM_FACEAPI: // Face API
+ ui.btnShowEngineControls->setEnabled ( false );
break;
- case 1: // FTNoir server
+ case FT_FTNOIR: // FTNoir server
ui.video_frame->hide();
ui.headPoseWidget->show();
+ ui.btnShowEngineControls->setEnabled ( true );
break;
default:
break;
diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index e6ebde75..698929cb 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -408,8 +408,8 @@ color:#000;</string> </property>
<property name="maximumSize">
<size>
- <width>250</width>
- <height>180</height>
+ <width>500</width>
+ <height>500</height>
</size>
</property>
<property name="styleSheet">
diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj index e56d9e5c..aeb346da 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.vcproj +++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj @@ -224,6 +224,10 @@ >
</File>
<File
+ RelativePath=".\FTNServer.cpp"
+ >
+ </File>
+ <File
RelativePath=".\FTServer.cpp"
>
</File>
@@ -440,6 +444,32 @@ </FileConfiguration>
</File>
<File
+ RelativePath=".\FTNServer.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\moc.exe" "$(InputPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp" -DQT_CORE_LIB -DQT_DLL -DQT_GUI_LIB -DQT_LARGEFILE_SUPPORT -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I"$(QTDIR)\include\." -I"$(QTDIR)\include\QtCore\." -I"$(QTDIR)\include\QtGui\." -I"$(QTDIR)\include\QtNetwork\." -I"$(QTDIR)\include\QtOpenGL\." -I"$(QTDIR)\include\QtTest\." -I"$(QTDIR)\include\QtWebKit\." -I"$(SM_API_CPP_WRAPPERS)\include\." -I"$(SM_API_PATH)\include\." -I"$(SM_API_QTDIR)\include\." -I"$(SM_API_WIDGETS)\include\." -I"$(SolutionDir)\FTNoIR_Filter_EWMA2\." -I"$(SolutionDir)\FTNoIR_Tracker_UDP\." -I".\GeneratedFiles\$(ConfigurationName)\." -I".\GeneratedFiles\."
"
+ AdditionalDependencies=""$(QTDIR)\bin\moc.exe";$(InputPath)"
+ Outputs="".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\moc.exe" "$(InputPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp" -DQT_CORE_LIB -DQT_DLL -DQT_GUI_LIB -DQT_LARGEFILE_SUPPORT -DQT_OPENGL_LIB -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I"$(QTDIR)\include\." -I"$(QTDIR)\include\QtCore\." -I"$(QTDIR)\include\QtGui\." -I"$(QTDIR)\include\QtNetwork\." -I"$(QTDIR)\include\QtOpenGL\." -I"$(QTDIR)\include\QtTest\." -I"$(QTDIR)\include\QtWebKit\." -I".\." -I".\GeneratedFiles\$(ConfigurationName)\." -I".\GeneratedFiles\."
"
+ AdditionalDependencies=""$(QTDIR)\bin\moc.exe";$(InputPath)"
+ Outputs="".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp""
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\FTServer.h"
>
<FileConfiguration
@@ -692,6 +722,32 @@ </FileConfiguration>
</File>
<File
+ RelativePath=".\FTNoIR_FTNServerControls.ui"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_$(InputName).h" "$(InputPath)"
"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="".\GeneratedFiles\ui_$(InputName).h""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_$(InputName).h" "$(InputPath)"
"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="".\GeneratedFiles\ui_$(InputName).h""
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\FTNoIR_KeyboardShortcuts.ui"
>
<FileConfiguration
@@ -837,6 +893,10 @@ >
</File>
<File
+ RelativePath=".\GeneratedFiles\ui_FTNoIR_FTNServerControls.h"
+ >
+ </File>
+ <File
RelativePath=".\GeneratedFiles\ui_FTNoIR_KeyboardShortcuts.h"
>
</File>
@@ -938,6 +998,18 @@ </FileConfiguration>
</File>
<File
+ RelativePath=".\GeneratedFiles\Release\moc_FTNServer.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\GeneratedFiles\Release\moc_FTServer.cpp"
>
<FileConfiguration
@@ -1098,6 +1170,29 @@ </FileConfiguration>
</File>
<File
+ RelativePath=".\GeneratedFiles\Debug\moc_FTNServer.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\GeneratedFiles\Debug\moc_FTServer.cpp"
>
<FileConfiguration
diff --git a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest index ca044622..324c707e 100644 --- a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest +++ b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest @@ -5,9 +5,4 @@ <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
- </dependentAssembly>
- </dependency>
</assembly>
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index bc7b45f8..f271ee5b 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -163,6 +163,7 @@ QLibrary *filterLib; break;
case FTNOIR:
+ server_Game = QSharedPointer<FTNServer>(new FTNServer ( this )); // Create FaceTrackNoIR protocol-server
break;
case PPJOY:
@@ -556,15 +557,15 @@ void Tracker::run() { if (Tracker::do_tracking && Tracker::confid) {
// Pitch
- target_camera_position.x = X.headPos - X.offset_headPos - X.initial_headPos;
- target_camera_position.y = Y.headPos - Y.offset_headPos - Y.initial_headPos;
- target_camera_position.z = Z.headPos - Z.offset_headPos - Z.initial_headPos;
- target_camera_position.pitch = Pitch.headPos - Pitch.offset_headPos - Pitch.initial_headPos;
- target_camera_position.yaw = Yaw.headPos - Yaw.offset_headPos - Yaw.initial_headPos;
- target_camera_position.roll = Roll.headPos - Roll.offset_headPos - Roll.initial_headPos;
+ target_camera_position.x = getSmoothFromList( &X.rawList ) - X.offset_headPos - X.initial_headPos;
+ target_camera_position.y = getSmoothFromList( &Y.rawList ) - Y.offset_headPos - Y.initial_headPos;
+ target_camera_position.z = getSmoothFromList( &Z.rawList ) - Z.offset_headPos - Z.initial_headPos;
+ target_camera_position.pitch = getSmoothFromList( &Pitch.rawList ) - Pitch.offset_headPos - Pitch.initial_headPos;
+ target_camera_position.yaw = getSmoothFromList( &Yaw.rawList ) - Yaw.offset_headPos - Yaw.initial_headPos;
+ target_camera_position.roll = getSmoothFromList( &Roll.rawList ) - Roll.offset_headPos - Roll.initial_headPos;
if (Tracker::useFilter && pFilter) {
- pFilter->FilterHeadPoseData(¤t_camera_position, &target_camera_position, &new_camera_position);
+ pFilter->FilterHeadPoseData(¤t_camera_position, &target_camera_position, &new_camera_position, Tracker::Pitch.newSample);
}
else {
new_camera_position.x = getSmoothFromList( &X.rawList ) - X.offset_headPos - X.initial_headPos;
@@ -658,9 +659,10 @@ void Tracker::run() { debug_Client->prev_value = Tracker::Pitch.prevPos;
debug_Client->dT = dT;
debug_Client->sendHeadposeToGame(); // Log to Excel
- Tracker::Pitch.newSample = false;
# endif
+ Tracker::Pitch.newSample = false;
+
ReleaseMutex(Tracker::hTrackMutex);
server_Game->sendHeadposeToGame();
@@ -694,10 +696,6 @@ void Tracker::receiveHeadPose(void *,smEngineHeadPoseData head_pose, smCameraVid }
ReleaseMutex(Tracker::hTrackMutex);
-
- // for lower cpu load
- msleep(10);
- yieldCurrentThread();
}
/** Add the headpose-data to the Lists **/
diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index 73d4161e..6c436ff8 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -43,6 +43,7 @@ #include "SCServer.h" // SimConnect-server (for MS Flight Simulator X)
#include "FSUIPCServer.h" // FSUIPC-server (for MS Flight Simulator 2004)
#include "ExcelServer.h" // Excel-server (for analysing purposes)
+#include "FTNServer.h" // FaceTrackNoIR-server (for client-server)
#include "FTNoIR_cxx_protocolserver.h"
#include "FTNoIR_Tracker_base.h"
diff --git a/bin/FaceTrackNoIR.exe b/bin/FaceTrackNoIR.exe Binary files differindex dd98c3ca..dde6f8bf 100644 --- a/bin/FaceTrackNoIR.exe +++ b/bin/FaceTrackNoIR.exe diff --git a/bin/Settings/SimConnect.ini b/bin/Settings/SimConnect.ini index d464d763..f14ed759 100644 --- a/bin/Settings/SimConnect.ini +++ b/bin/Settings/SimConnect.ini @@ -1,5 +1,5 @@ [Tracking]
-Smooth=4
+Smooth=10
invertYaw=false
invertPitch=false
invertRoll=false
@@ -13,9 +13,9 @@ redRoll=90 redX=90
redY=90
redZ=90
-minSmooth=10
-powCurve=10
-maxSmooth=70
+minSmooth=15
+powCurve=2
+maxSmooth=80
[GameProtocol]
Selection=5
@@ -37,17 +37,17 @@ Roll_point2=@Variant(\0\0\0\x1a@1\0\0\0\0\0\0@1\0\0\0\0\0\0) Roll_point3=@Variant(\0\0\0\x1a@@\x80\0\0\0\0\0@@\x80\0\0\0\0\0)
Roll_point4=@Variant(\0\0\0\x1a@f \0\0\0\0\0@I\0\0\0\0\0\0)
X_point1=@Variant(\0\0\0\x1a\0\0\0\0\0\0\0\0?\xf0\0\0\0\0\0\0)
-X_point2=@Variant(\0\0\0\x1a@K@\0\0\0\0\0@5\x80\0\0\0\0\0)
-X_point3=@Variant(\0\0\0\x1a@T \0\0\0\0\0@A\x80\0\0\0\0\0)
+X_point2=@Variant(\0\0\0\x1a@K\x80\0\0\0\0\0@6\0\0\0\0\0\0)
+X_point3=@Variant(\0\0\0\x1a@T@\0\0\0\0\0@A\x80\0\0\0\0\0)
X_point4=@Variant(\0\0\0\x1a@[@\0\0\0\0\0@I\0\0\0\0\0\0)
Y_point1=@Variant(\0\0\0\x1a\0\0\0\0\0\0\0\0?\xf0\0\0\0\0\0\0)
-Y_point2=@Variant(\0\0\0\x1a@M@\0\0\0\0\0@3\0\0\0\0\0\0)
-Y_point3=@Variant(\0\0\0\x1a@X\xc0\0\0\0\0\0@B\xc0\0\0\0\0\0)
+Y_point2=@Variant(\0\0\0\x1a@M\x80\0\0\0\0\0@3\0\0\0\0\0\0)
+Y_point3=@Variant(\0\0\0\x1a@X\xc0\0\0\0\0\0@C\0\0\0\0\0\0)
Y_point4=@Variant(\0\0\0\x1a@[\x80\0\0\0\0\0@I\0\0\0\0\0\0)
Z_point1=@Variant(\0\0\0\x1a\0\0\0\0\0\0\0\0?\xf0\0\0\0\0\0\0)
-Z_point2=@Variant(\0\0\0\x1a@J\xc0\0\0\0\0\0@3\0\0\0\0\0\0)
-Z_point3=@Variant(\0\0\0\x1a@T\x80\0\0\0\0\0@B\xc0\0\0\0\0\0)
-Z_point4=@Variant(\0\0\0\x1a@\\`\0\0\0\0\0@I\0\0\0\0\0\0)
+Z_point2=@Variant(\0\0\0\x1a@K\0\0\0\0\0\0@3\0\0\0\0\0\0)
+Z_point3=@Variant(\0\0\0\x1a@T\x80\0\0\0\0\0@C\0\0\0\0\0\0)
+Z_point4=@Variant(\0\0\0\x1a@\\\x80\0\0\0\0\0@I\0\0\0\0\0\0)
[KB_Shortcuts]
Keycode_Center=199
@@ -69,3 +69,11 @@ Inhibit_Roll=false Inhibit_X=false
Inhibit_Y=false
Inhibit_Z=false
+
+[FTN]
+LocalPCOnly=true
+IP-1=127
+IP-2=0
+IP-3=0
+IP-4=1
+PortNumber=5550
diff --git a/bin/image6.0.dll b/bin/image6.0.dll Binary files differindex 5024bd10..17a1e7b4 100644 --- a/bin/image6.0.dll +++ b/bin/image6.0.dll |