Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ private void configureBindings() {

// When the shooter isnt shooting, get it ready to shoot.
shooter_.setDefaultCommand(shooter_.awaitShooting(drivebase_::getPose));

//While the A button is held, the intake will run the eject sequence. If it the intake is stowed, it will also deploy it.
gamepad_.a().whileTrue(intake_.ejectSequence());
}

private void configureDriveBindings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public final class IntakeConstants {

public static final AngularVelocity rollerMaxVelocity= DegreesPerSecond.of(360); //Temporary speed to be changed as needed
public static final Voltage rollerCollectVoltage= Volts.of(6); //Temporary voltage
public static final Voltage rollerEjectVoltage= Volts.of(-6); //Temporary voltage

public static final Angle pivotTolerance = Degrees.of(5); //Tolerance to compare current angle to target

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ private void stopIntaking() {
io.stopRoller();
}

private void eject(){
io.setRollerVoltage(IntakeConstants.rollerEjectVoltage);
}

/**
* Stows the intake and hopper.
*/
Expand Down Expand Up @@ -150,6 +154,16 @@ public Command intakeSequence() {
).finallyDo(interrupted -> waiting());
}

public Command runEjectCmd() {
return startEnd(this::eject, this::stopIntaking);
}

public Command ejectSequence() {
return runEjectCmd().beforeStarting(
deployCmd().unless(this::isIntakeDeployed)
).finallyDo(interrupted -> waiting());
}

////////////////////////////
/// Sys ID Routine creation/
/// ////////////////////////
Expand Down
Loading