summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-03-18 16:52:19 +0100
committerStéphane Lenclud <github@lenclud.com>2019-03-18 16:52:19 +0100
commitf5a5777e2711ac342b9cab517ac3bfba0313bdaf (patch)
treee5db648eb4d79b332dcf02b4ed4f93c67572cc48 /tracker-pt/ftnoir_tracker_pt.cpp
parent6d98d70ea4be87f8bf9a5304bd6defe795df21f9 (diff)
Auto-reset when detecting absurd angles.kinect-point-tracker
Better buffer scaling to focus on the relevant part of our spectrum.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 1f4afe46..797e28dc 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -214,13 +214,22 @@ void Tracker_PT::data(double *data)
data[TX] = (double)t[0] / 10;
data[TY] = (double)t[1] / 10;
data[TZ] = (double)t[2] / 10;
+
+ // Workaround an issue where our tracker is stuck reporting extrem roll and yaw values around +/-170
+ // Using Kinect with a cap this is easy to reproduce by getting close enough from the sensor (<50cm) and stepping back.
+ if (data[Roll] > 100 || data[Roll] < -100 || data[Pitch] < -60 )
+ {
+ // Hopefully our user did not break his neck, something is wrong, reset our tracker
+ QMutexLocker l(&center_lock);
+ point_tracker.reset_state();
+ // TODO: Provide the last valid data frame instead
+ }
}
}
bool Tracker_PT::center()
{
QMutexLocker l(&center_lock);
-
point_tracker.reset_state();
return false;
}