From 28495e91b2716bbc2aaa92d79a6f414252fc013c Mon Sep 17 00:00:00 2001 From: nanthony21 Date: Thu, 25 Jan 2018 00:33:52 -0600 Subject: [PATCH] If using deadband then use the deadband value to detect if sticks have be recentered after calibration. --- src/VehicleSetup/JoystickConfigController.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VehicleSetup/JoystickConfigController.cc b/src/VehicleSetup/JoystickConfigController.cc index 67a3ffa1e..08badb5ea 100644 --- a/src/VehicleSetup/JoystickConfigController.cc +++ b/src/VehicleSetup/JoystickConfigController.cc @@ -416,8 +416,8 @@ void JoystickConfigController::_inputCenterWait(Joystick::AxisFunction_t functio if (_stickDetectAxis == _axisNoAxis) { // Sticks have not yet moved close enough to center - - if (abs(_calCenterPoint - value) < _calRoughCenterDelta) { + int roughCenter = getDeadbandToggle() ? _rgAxisInfo[axis].deadband : _calRoughCenterDelta; + if (abs(_calCenterPoint - value) < roughCenter) { // Stick has moved close enough to center that we can start waiting for it to settle _stickDetectAxis = axis; _stickDetectInitialValue = value; -- 2.22.0