Command Gamepad
CommandGamepad wraps the standard FTC Gamepad and exposes its buttons and sticks as command-based Triggers.
This lets you map controller inputs directly to commands using the WPILib-style Trigger API.
Creating a CommandGamepad
Section titled “Creating a CommandGamepad”val gp1 = CommandGamepad(gamepad1)CommandGamepad gp1 = new CommandGamepad(gamepad1);CommandGamepad accepts an optional eventLoop parameter, defaulting to Trigger.defaultEventLoop.
You generally won’t need to override it unless you’re managing multiple event loops.
Every button is exposed as a Trigger, which you can bind to commands with methods like onTrue() or onFalse() etc.
gp1.circle.onTrue(robot.intake.on())gp1.circle.onFalse(robot.intake.off())gp1.circle().onTrue(robot.intake.on());gp1.circle().onFalse(robot.intake.off());Sticks and Triggers
Section titled “Sticks and Triggers”Joysticks and gamepad triggers are exposed as RangeTriggers instead of regular Triggers,
since they report an analog value rather than a boolean value, letting you
gp1.rightTrigger.isOver(0.2).onTrue(robot.launcher.launch())gp1.rightTrigger().isOver(0.2).onTrue(robot.launcher.launch());