diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-13 13:50:57 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-13 13:52:45 +0200 |
commit | 3e5dddf12b451c468eaaecceafca78b2f70b8a9b (patch) | |
tree | 9b1d67a73c5af6942a340fbdd156864c118c3bf5 /logic | |
parent | f9a4ccb88248f3b8b0082caba328b32ffc5d18b0 (diff) |
logic/tracker: call center() before data()
For real this time.
Issue: #352
Diffstat (limited to 'logic')
-rw-r--r-- | logic/tracker.cpp | 16 |
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; |