From 5e8c5f2c4646f7ad19da5781f83f2c5fc7761ec0 Mon Sep 17 00:00:00 2001 From: Nick Anthony Date: Mon, 5 Feb 2018 00:07:48 -0600 Subject: [PATCH] Minor improvement to detection of stick recentering after calibration. Without this if you performed a calibration with deadband enabled but one of the deadbands at the end of the calibration was ~0 it would be very difficult to position the stick so that Qgroundcontrol considered the axis to be centered. --- src/VehicleSetup/JoystickConfigController.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VehicleSetup/JoystickConfigController.cc b/src/VehicleSetup/JoystickConfigController.cc index b2bffc8b3..8b4f0b6fd 100644 --- a/src/VehicleSetup/JoystickConfigController.cc +++ b/src/VehicleSetup/JoystickConfigController.cc @@ -415,7 +415,7 @@ void JoystickConfigController::_inputCenterWait(Joystick::AxisFunction_t functio if (_stickDetectAxis == _axisNoAxis) { // Sticks have not yet moved close enough to center - int roughCenter = getDeadbandToggle() ? _rgAxisInfo[axis].deadband : _calRoughCenterDelta; + int roughCenter = getDeadbandToggle() ? std::max(_rgAxisInfo[axis].deadband,_calRoughCenterDelta) : _calRoughCenterDelta; if (abs(_calCenterPoint - value) < roughCenter) { // Stick has moved close enough to center that we can start waiting for it to settle _stickDetectAxis = axis; -- 2.22.0