From f5770a675ec0a716fb5f0350f4ff48f17f252105 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 12 Jun 2017 23:27:46 +0200 Subject: logic/tracker: unrotate position data --- logic/tracker.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'logic') diff --git a/logic/tracker.cpp b/logic/tracker.cpp index ffa3eff4..7f546236 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -225,6 +225,9 @@ void Tracker::logic() } euler_t pos = euler_t(&value[TX]) - t_center; + + t_compensate(real_rotation.rot_center, pos, pos, false, false, false); + euler_t rot = r2d * c_mult * rmat_to_euler(rotation); for (int i = 0; i < 3; i++) @@ -398,9 +401,14 @@ void Tracker::run() backlog_time += ns(elapsed_nsecs - const_sleep_ms); - const int sleep_time_ms = iround((time_cast(clamp(const_sleep_ms - backlog_time, - ms_::zero(), ms_(50)))) - .count()); + const int sleep_time_ms = time_cast(clamp(const_sleep_ms - backlog_time, + ms_::zero(), ms_(10))).count(); + +#if 0 + qDebug() << "sleepy time" << sleep_time_ms + << "elapsed" << time_cast(elapsed_nsecs).count() + << "backlog" << time_cast(backlog_time).count(); +#endif portable::sleep(sleep_time_ms); } -- cgit v1.2.3