From 945b229861a6e8eb24083ddd97017eaa9e74573e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 6 Jun 2015 10:41:11 +0200 Subject: tracker: revert to filtering before mapping As a side effect, current position on mapping graphs no longer jumps around. --- opentrack/tracker.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'opentrack') diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 1990d613..c124111f 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -97,8 +97,8 @@ void Tracker::logic() } const double off[] = { - (double)s.camera_yaw, - (double)s.camera_pitch, + (double)-s.camera_yaw, + (double)-s.camera_pitch, (double)s.camera_roll }; const rmat cam = rmat::euler_to_rmat(off); @@ -140,25 +140,22 @@ void Tracker::logic() } } - for (int i = 3; i < 6; i++) - value(i) = map(value(i), m(i)); - { Pose tmp = value; if (libs.pFilter) libs.pFilter->filter(tmp, value); } - + + for (int i = 0; i < 6; i++) + value(i) = map(value(i), m(i)); + if (s.tcomp_p) t_compensate(rmat::euler_to_rmat(&value[Yaw]), value, value, s.tcomp_tz); - for (int i = 0; i < 3; i++) - value(i) = map(value(i), m(i)); - for (int i = 0; i < 6; i++) value[i] *= inverts[i] ? -1. : 1.; -- cgit v1.2.3