From 25ac2117ec6b9f4b48e53c7d3dbc512d739830af Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 18:03:19 +0200 Subject: add a 3rdparty notice Signed-off-by: Stanislaw Halik --- 3rdparty-notices/NFAILCLIENT-CREDIT.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 3rdparty-notices/NFAILCLIENT-CREDIT.txt diff --git a/3rdparty-notices/NFAILCLIENT-CREDIT.txt b/3rdparty-notices/NFAILCLIENT-CREDIT.txt new file mode 100644 index 00000000..7a69b0ae --- /dev/null +++ b/3rdparty-notices/NFAILCLIENT-CREDIT.txt @@ -0,0 +1,4 @@ +NFailClient is a clean-room implementation of NFail LLC NFailClient. + +Completed as an operation spanning the whole Europe, NFailClient was +written by gnomes, halflings and rakshasa. \ No newline at end of file -- cgit v1.2.3 From 4bde5b3cfc82348d822bcd99a0ca6bab022b2933 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 18:12:24 +0200 Subject: improve wine wrapper subprocess handling Signed-off-by: Stanislaw Halik --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index c5d0754f..d9c3f1e0 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -19,9 +19,14 @@ FTNoIR_Protocol::~FTNoIR_Protocol() { if (shm) { shm->stop = true; - wrapper.waitForFinished(2000); + wrapper.waitForFinished(100); + } + wrapper.terminate(); + if (!wrapper.waitForFinished(100)) + { + wrapper.kill(); + wrapper.waitForFinished(42); } - wrapper.kill(); shm_unlink("/" WINE_SHM_NAME); } -- cgit v1.2.3 From 542c5e475f151ba7f531e3128a3bcead247a317c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 20:14:10 +0200 Subject: main: ignore confid errors Signed-off-by: Stanislaw Halik --- facetracknoir/tracker.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 38b70199..c0fe4eef 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -70,7 +70,7 @@ void Tracker::run() { bool bTracker1Confid = false; bool bTracker2Confid = false; - double newpose[6]; + double newpose[6] = {0}; double last_post_filter[6]; #if defined(_WIN32) @@ -82,9 +82,6 @@ void Tracker::run() { if (should_quit) break; - for (int i = 0; i < 6; i++) - newpose[i] = 0; - // // The second tracker serves as 'secondary'. So if an axis is written by the second tracker it CAN be overwritten by the Primary tracker. // This is enforced by the sequence below. -- cgit v1.2.3 From e248b039d1110dddc5c3ee13172b75a818f6d265 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 20:36:09 +0200 Subject: ignore confid values wrt submitting pose to game Signed-off-by: Stanislaw Halik --- facetracknoir/tracker.cpp | 83 ++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 52 deletions(-) diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index c0fe4eef..980415c8 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -35,8 +35,8 @@ Tracker::Tracker( FaceTrackNoIR *parent ) : enabled(true) { // Retieve the pointer to the parent - mainApp = parent; - // Load the settings from the INI-file + mainApp = parent; + // Load the settings from the INI-file } Tracker::~Tracker() @@ -60,12 +60,7 @@ static void get_curve(double pos, double& out, THeadPoseDOF& axis) { /** QThread run method @override **/ void Tracker::run() { - T6DOF target_camera; - T6DOF new_camera; - - /** Direct Input variables **/ - T6DOF offset_camera; - T6DOF gameoutput_camera; + T6DOF offset_camera, new_camera, gameoutput_camera, target_camera, target_camera2; bool bTracker1Confid = false; bool bTracker2Confid = false; @@ -78,14 +73,10 @@ void Tracker::run() { #endif for (;;) - { + { if (should_quit) break; - // - // The second tracker serves as 'secondary'. So if an axis is written by the second tracker it CAN be overwritten by the Primary tracker. - // This is enforced by the sequence below. - // if (Libraries->pSecondTracker) { bTracker2Confid = Libraries->pSecondTracker->GiveHeadPoseData(newpose); } @@ -97,57 +88,45 @@ void Tracker::run() { { QMutexLocker foo(&mtx); const bool confid = bTracker1Confid || bTracker2Confid; - + if ( confid ) { for (int i = 0; i < 6; i++) mainApp->axis(i).headPos = newpose[i]; } - - // - // If Center is pressed, copy the current values to the offsets. - // + if (do_center) { - // - // Only copy valid values - // for (int i = 0; i < 6; i++) - offset_camera.axes[i] = mainApp->axis(i).headPos; - + offset_camera.axes[i] = target_camera.axes[i]; + do_center = false; - + if (Libraries->pFilter) Libraries->pFilter->Initialize(); } - - if (confid && enabled) { - // get values + + if (enabled && confid) + { for (int i = 0; i < 6; i++) target_camera.axes[i] = mainApp->axis(i).headPos; - - // do the centering - target_camera = target_camera - offset_camera; - - // - // Use advanced filtering, when a filter was selected. - // - if (Libraries->pFilter) { - for (int i = 0; i < 6; i++) - last_post_filter[i] = gameoutput_camera.axes[i]; - Libraries->pFilter->FilterHeadPoseData(target_camera.axes, new_camera.axes, last_post_filter); - } - else { - new_camera = target_camera; - } - - for (int i = 0; i < 6; i++) { - get_curve(new_camera.axes[i], output_camera.axes[i], mainApp->axis(i)); - } - - // Send the headpose to the game - if (Libraries->pProtocol) { - gameoutput_camera = output_camera; - Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes ); // degrees & centimeters - } + + target_camera2 = target_camera - offset_camera; + } + + if (Libraries->pFilter) { + for (int i = 0; i < 6; i++) + last_post_filter[i] = gameoutput_camera.axes[i]; + Libraries->pFilter->FilterHeadPoseData(target_camera2.axes, new_camera.axes, last_post_filter); + } else { + new_camera = target_camera2; + } + + for (int i = 0; i < 6; i++) { + get_curve(new_camera.axes[i], output_camera.axes[i], mainApp->axis(i)); + } + + if (Libraries->pProtocol) { + gameoutput_camera = output_camera; + Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes ); // degrees & centimeters } } -- cgit v1.2.3