diff --git a/CompetitionSoftware/src/main/java/frc/robot/Robot.java b/CompetitionSoftware/src/main/java/frc/robot/Robot.java index a89ee8b..c2ed899 100644 --- a/CompetitionSoftware/src/main/java/frc/robot/Robot.java +++ b/CompetitionSoftware/src/main/java/frc/robot/Robot.java @@ -11,6 +11,7 @@ import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.cscore.UsbCamera; import edu.wpi.first.cscore.VideoSource.ConnectionStrategy; +import edu.wpi.first.wpilibj.RobotController; /** * The VM is configured to automatically run this class, and to call the functions corresponding to @@ -28,7 +29,7 @@ public class Robot extends TimedRobot { public static final int kDriverCameraResolutionX = 640; public static final int kDriverCameraResolutionY = 360; public static final int kDriverCameraFPS = 15; - + private UsbCamera driverCamera; /** @@ -101,14 +102,16 @@ public void teleopInit() { // Get the driver's choice of control system - arcade or tank drive. m_robotContainer.setDriveType(); - + //TODO Do all motors need to be turned off here? } /** This function is called periodically during operator control. */ @Override public void teleopPeriodic() { - + if(RobotController.getUserButton()){ + m_robotContainer.disableCompressor(); + } } @Override diff --git a/CompetitionSoftware/src/main/java/frc/robot/RobotContainer.java b/CompetitionSoftware/src/main/java/frc/robot/RobotContainer.java index fca56a4..f067c1f 100644 --- a/CompetitionSoftware/src/main/java/frc/robot/RobotContainer.java +++ b/CompetitionSoftware/src/main/java/frc/robot/RobotContainer.java @@ -55,25 +55,25 @@ public class RobotContainer { new JoystickButton(m_operatorController, OperatorConstants.kClimbDown); // Note Handling Buttons - private final JoystickButton m_intakeAutoButton = + private final JoystickButton m_intakeAutoButton = new JoystickButton(m_operatorController, OperatorConstants.kIntakeAuto); - private final JoystickButton m_outputButton = + private final JoystickButton m_outputButton = new JoystickButton(m_operatorController, OperatorConstants.kOutput); - private final JoystickButton m_intakeManualButton = + private final JoystickButton m_intakeManualButton = new JoystickButton(m_operatorController, OperatorConstants.kIntakeManual); - private final JoystickButton m_fullStopButton = + private final JoystickButton m_fullStopButton = new JoystickButton(m_operatorController, OperatorConstants.kFullStop); // Goose Rotation Buttons - private final JoystickButton m_moveArmTopButton = + private final JoystickButton m_moveArmTopButton = new JoystickButton(m_operatorController, OperatorConstants.kMoveArmTop); - private final JoystickButton m_moveArmBottomButton = + private final JoystickButton m_moveArmBottomButton = new JoystickButton(m_operatorController, OperatorConstants.kMoveArmBottom); /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { m_pnuematicHub.enableCompressorAnalog(RobotConstants.minPnuematicsPressure,RobotConstants.maxPnuematicsPressure); - + // Set up SmartDashboard/Shuffleboard widgets for driver/operator use. configureDriverStationControls(); @@ -114,7 +114,7 @@ private void configureDriverStationControls() SmartDashboard.putData(m_driveTypeChooser); } - private void configureBindings() + private void configureBindings() { // Drive Controllers. We set arcade drive as the default here but may change this // during teleopInit depending upon the value of a dashboard chooser. @@ -125,23 +125,23 @@ private void configureBindings() m_climbDownButton.onTrue(new ClimbCommand(m_climbSubsystem, ClimbSubsystem.State.GROUNDED)); // Note handling Buttons - m_intakeAutoButton.onTrue(new AutoNoteIntakeCommand(m_noteHandlingSubsystem, + m_intakeAutoButton.onTrue(new AutoNoteIntakeCommand(m_noteHandlingSubsystem, NoteHandlingConstants.kIntakeSpeed)); - m_intakeManualButton.onTrue(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem, + m_intakeManualButton.onTrue(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem, NoteHandlingConstants.kIntakeSpeed)); m_intakeManualButton.onFalse(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem,0.0)); - - m_outputButton.onTrue(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem, + + m_outputButton.onTrue(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem, NoteHandlingConstants.kOutputSpeed)); m_outputButton.onFalse(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem,0.0)); m_fullStopButton.onTrue(new NoteHandlingSpeedCommand(m_noteHandlingSubsystem,0.0)); // Goose Rotation Buttons - m_moveArmTopButton.onTrue(new RotateCommand(m_rotationSubsystem, + m_moveArmTopButton.onTrue(new RotateCommand(m_rotationSubsystem, GooseRotationConstants.kTopAngle)); - m_moveArmBottomButton.onTrue(new RotateCommand(m_rotationSubsystem, + m_moveArmBottomButton.onTrue(new RotateCommand(m_rotationSubsystem, GooseRotationConstants.kBottomAngle)); } @@ -161,4 +161,8 @@ public void setDriveType() Boolean bArcade = m_driveTypeChooser.getSelected(); m_driveSubsystem.initDefaultCommand(m_driverJoystickLeft, m_driverJoystickRight, bArcade); } + + public void disableCompressor(){ + m_pnuematicHub.setCompressor(false); + } }