Commit 5e8c5f2c authored by Nick Anthony's avatar Nick Anthony

Minor improvement to detection of stick recentering after calibration. Without...

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.
parent 9088c234
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment