summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-13 13:50:57 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-13 13:52:45 +0200
commit3e5dddf12b451c468eaaecceafca78b2f70b8a9b (patch)
tree9b1d67a73c5af6942a340fbdd156864c118c3bf5
parentf9a4ccb88248f3b8b0082caba328b32ffc5d18b0 (diff)
logic/tracker: call center() before data()
For real this time. Issue: #352
-rw-r--r--logic/tracker.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index bb207e22..029a64c6 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -126,6 +126,15 @@ void Tracker::logic()
set(f_center, false);
const bool own_center_logic = center_ordered && libs.pTracker->center();
+ {
+ Pose tmp;
+ libs.pTracker->data(tmp);
+
+ if (get(f_enabled))
+ for (int i = 0; i < 6; i++)
+ newpose[i] = elide_nan(tmp(i), newpose(i));
+ }
+
Pose value, raw;
for (int i = 0; i < 6; i++)
@@ -390,13 +399,6 @@ void Tracker::run()
while (!get(f_should_quit))
{
- Pose tmp;
- libs.pTracker->data(tmp);
-
- if (get(f_enabled))
- for (int i = 0; i < 6; i++)
- newpose[i] = elide_nan(tmp(i), newpose(i));
-
logic();
static constexpr long const_sleep_us = 4000;