diff options
| author | Stéphane Lenclud <github@lenclud.com> | 2019-03-18 16:52:19 +0100 |
|---|---|---|
| committer | Stéphane Lenclud <github@lenclud.com> | 2019-03-18 16:52:19 +0100 |
| commit | f5a5777e2711ac342b9cab517ac3bfba0313bdaf (patch) | |
| tree | e5db648eb4d79b332dcf02b4ed4f93c67572cc48 /tracker-pt/ftnoir_tracker_pt.cpp | |
| parent | 6d98d70ea4be87f8bf9a5304bd6defe795df21f9 (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.cpp | 11 |
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(¢er_lock); + point_tracker.reset_state(); + // TODO: Provide the last valid data frame instead + } } } bool Tracker_PT::center() { QMutexLocker l(¢er_lock); - point_tracker.reset_state(); return false; } |
