parseInputs method

  1. @override
List<Message> parseInputs(
  1. GamepadState state
)
override

Return a list of commands based on the current state of the gamepad.

Implementation

@override
List<Message> parseInputs(GamepadState state) {
  final leftInput = state.normalLeftY;
  final rightInput = -state.normalRightY;

  return [
    DriveCommand(throttle: throttleLimiter.calculate(throttle), setThrottle: true),
    DriveCommand(setLeft: true, left: leftLimiter.calculate(leftInput)),
    DriveCommand(setRight: true, right: rightLimiter.calculate(rightInput)),
  ];
}