summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/ExcelServer.cpp
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-01-10 20:28:59 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-01-10 20:28:59 +0000
commitd0132f5e3881a6cb09bfe41326831d36527b7321 (patch)
tree94a7c4c191d77b8711cc62cedb15caca74bb7e15 /FaceTrackNoIR/ExcelServer.cpp
parentfa0149df2e558680918b772a13e507ccce66d74b (diff)
Basic Excel tracking.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@38 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/ExcelServer.cpp')
-rw-r--r--FaceTrackNoIR/ExcelServer.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/FaceTrackNoIR/ExcelServer.cpp b/FaceTrackNoIR/ExcelServer.cpp
index d512ef7a..097be513 100644
--- a/FaceTrackNoIR/ExcelServer.cpp
+++ b/FaceTrackNoIR/ExcelServer.cpp
@@ -32,6 +32,7 @@
#include <QtGui>
#include "ExcelServer.h"
#include "Tracker.h"
+#include <Windows.h>
/** constructor **/
ExcelServer::ExcelServer( Tracker *parent ) {
@@ -48,6 +49,21 @@ ExcelServer::~ExcelServer() {
// Update Headpose in Game.
//
void ExcelServer::sendHeadposeToGame() {
+SYSTEMTIME now;
+
+ //
+ // Get the System-time and substract the time from the previous call.
+ // dT will be used for the EWMA-filter.
+ //
+ GetSystemTime ( &now );
+ long newHeadPoseTime = (((now.wHour * 3600) + (now.wMinute * 60) + now.wSecond) * 1000) + now.wMilliseconds;
+
+ // Use this for some debug-output to file...
+ QFile data(QCoreApplication::applicationDirPath() + "\\output.txt");
+ if (data.open(QFile::WriteOnly | QFile::Append)) {
+ QTextStream out(&data);
+ out << newHeadPoseTime << "\t" << headRotX << "\t" << virtRotX << "\t" << headRotY << "\t" << virtRotY << "\t" << headRotZ << "\t" << virtRotZ << '\n';
+ }
}
//
@@ -56,6 +72,14 @@ void ExcelServer::sendHeadposeToGame() {
//
bool ExcelServer::checkServerInstallationOK( HANDLE handle )
{
+ // Use this for some debug-output to file...
+ QFile data(QCoreApplication::applicationDirPath() + "\\output.txt");
+ if (data.open(QFile::WriteOnly)) {
+ QTextStream out(&data);
+ out << "Time" << "\t" << "RotX (Pitch)" << "\t" << "RotX (Pitch)" << "\t" << "RotY (Yaw)" << "\t" << "RotY (Yaw)" << "\t" << "RotY (Roll)" << "\t" << "RotY (Roll)" << '\n';
+ out << "(long)" << "\t" << "Raw" << "\t" << "Filtered" << "\t" << "Raw" << "\t" << "Filtered" << "\t" << "Raw" << "\t" << "Filtered" << '\n';
+ }
+
return true;
}