1212import edu .wpi .first .wpilibj .Joystick ;
1313import edu .wpi .first .wpilibj .buttons .JoystickButton ;
1414import frc .robot .commands .ActuateClimberRails ;
15- import frc .robot .commands .NormalDrive ;
1615import frc .robot .commands .Climb ;
1716import frc .robot .commands .EjectCargo ;
1817import frc .robot .commands .IntakeOnlyCargo ;
1918import frc .robot .commands .ManualClimb ;
19+ import frc .robot .commands .NormalDrive ;
20+ import frc .robot .commands .ResetWobble ;
2021import frc .robot .commands .SetArcadeOrTank ;
2122import frc .robot .commands .SlowDrive ;
2223import frc .robot .commands .ToggleCamera ;
2324import frc .robot .commands .ToggleHatch ;
25+ import frc .robot .commands .ToggleLight ;
2426import frc .robot .commands .WobbleDrive ;
2527import frc .robot .subsystems .Cargo ;
2628import frc .robot .subsystems .Climber ;
2729import frc .robot .subsystems .Drivetrain ;
2830import frc .robot .subsystems .HatchPanel ;
31+ import frc .robot .subsystems .Lights ;
2932
3033/**
3134 * This class is the glue that binds the controls on the physical operator
@@ -43,9 +46,10 @@ public class OI {
4346 JoystickButton climbBtn ;
4447 JoystickButton toggleCameraBtn ;
4548 JoystickButton wobbleDriveBtn ;
49+ JoystickButton cycleLightBtn ;
4650
47- OI (Drivetrain dt , HatchPanel hp , Cargo cargo , Climber climber , UsbCamera driveCamera , UsbCamera hatchCamera ,
48- VideoSink cameraServer ) {
51+ OI (Drivetrain dt , HatchPanel hp , Cargo cargo , Climber climber , Lights lights , UsbCamera driveCamera ,
52+ UsbCamera hatchCamera , VideoSink cameraServer ) {
4953 leftJoy = new Joystick (0 );
5054 rightJoy = new Joystick (1 );
5155 manipulator = new Joystick (2 );
@@ -55,7 +59,8 @@ public class OI {
5559 rightSlowBtn = new JoystickButton (rightJoy , 1 );
5660 rightSlowBtn .whileHeld (new SlowDrive (SlowDrive .Side .RIGHT ));
5761 wobbleDriveBtn = new JoystickButton (rightJoy , 4 ); // TODO: confirm button with drivers
58- wobbleDriveBtn .whileHeld (new WobbleDrive (dt ));
62+ wobbleDriveBtn .whenPressed (new WobbleDrive (dt ));
63+ wobbleDriveBtn .whenReleased (new ResetWobble (dt ));
5964
6065 arcadeOrTankBtn = new JoystickButton (leftJoy , 4 );
6166 arcadeOrTankBtn .whenPressed (new SetArcadeOrTank ());
@@ -78,6 +83,9 @@ public class OI {
7883
7984 toggleCameraBtn = new JoystickButton (leftJoy , 2 );
8085 toggleCameraBtn .whenPressed (new ToggleCamera (driveCamera , hatchCamera , cameraServer ));
86+
87+ cycleLightBtn = new JoystickButton (manipulator , Manip .START );
88+ cycleLightBtn .whenPressed (new ToggleLight (lights ));
8189 }
8290
8391 private class Manip {
0 commit comments