From 5d2d9bc14c0b97a2f5d3f5be6e533966f5a4df39 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Sep 2014 04:25:40 +0200 Subject: Don't cut ranges in half needlessly Issue: #38 --- ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftnoir_tracker_joystick') diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp index 195dd760..cbb4440e 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp @@ -225,8 +225,8 @@ void FTNoIR_Tracker::GetHeadPoseData(double *data) auto mid = (min_[idx] + max_[idx]) / 2; auto val = values[idx] - mid; - auto max = (max_[idx] - mid) * 2; - auto min = (mid - min_[idx]) * 2; + auto max = (max_[idx] - mid); + auto min = (mid - min_[idx]); data[i] = val * limits[i] / (double) (val > mid ? max : min); } } -- cgit v1.2.3