1
0
forked from Clones/Controlify

✏️ Greatly improve gyro control

This commit is contained in:
isXander
2023-06-04 12:08:03 +01:00
parent 5669ea9b3a
commit daee2de327
8 changed files with 73 additions and 13 deletions

View File

@ -85,7 +85,9 @@ public class GamepadController extends AbstractController<GamepadState, GamepadC
}
}
GamepadState.GyroState gyroState = drivers.gyroDriver().getGyroState();
// todo: make this configurable
GamepadState.GyroState gyroState = drivers.gyroDriver().getGyroState().deadzone(0.05f);
this.absoluteGyro = this.absoluteGyro.add(gyroState);
state = new GamepadState(deadzoneAxesState, basicState.axes(), basicState.buttons(), gyroState, absoluteGyro);
}