Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CompetitionSoftware/src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

/**
Expand Down Expand Up @@ -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
Expand Down
32 changes: 18 additions & 14 deletions CompetitionSoftware/src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently my VSCode line endings are different

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();

Expand Down Expand Up @@ -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.
Expand All @@ -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));
}

Expand All @@ -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);
}
}