From a562bd75bd788bd2399aa4a96ba3276c22a77518 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 Aug 2016 22:29:35 +0200 Subject: logic/tracker: cleanup gimbal lock fix There were too many cases of variables with a "_real" suffix and without. Move both cases into struct data members. Also add experimental camera centering method. Cleanup some other stuff like "is_nan" should take an arbitrary Mat. --- logic/tracker.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'logic/tracker.h') diff --git a/logic/tracker.h b/logic/tracker.h index d3c2660b..6e5faddf 100644 --- a/logic/tracker.h +++ b/logic/tracker.h @@ -50,8 +50,19 @@ private: // the logger while the tracker is running. TrackLogger &logger; - rmat r_b, r_b_real; - double t_b[3]; + struct state + { + rmat center_yaw, center_pitch, center_roll; + rmat rot_center; + rmat camera; + rmat rotation, ry, rp, rr; + + state() : center_yaw(rmat::eye()), center_pitch(rmat::eye()), center_roll(rmat::eye()), rot_center(rmat::eye()) + {} + }; + + state real_rotation, scaled_rotation; + euler_t t_center; volatile bool centerp; volatile bool enabledp; -- cgit v1.2.3