Skip to content

Commit

Permalink
added automatic amp sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticalApple committed Apr 3, 2024
1 parent 7d88dc2 commit 90b4d66
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/main/java/frc/robot/commands/auton/AutoAmpSequence.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package frc.robot.commands.auton;

import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.intake.roller.IntakeRollerOuttakeCommand;
import frc.robot.commands.sequences.PrepareAmpSequence;
import frc.robot.commands.swerve.AlignCommand;
import frc.robot.subsystems.FieldManagementSubsystem;
import frc.robot.subsystems.elevator.ElevatorSubsystem;
import frc.robot.subsystems.intake.IntakePivotSubsystem;
import frc.robot.subsystems.intake.IntakeRollerSubsystem;
import frc.robot.subsystems.swerve.SwerveSubsystem;

/** Automatically runs an amp cycle including preparing the note, going to and aligning with the amp, and depositing the
* note (given that the robot already has a note). */
public class AutoAmpSequence extends SequentialCommandGroup {

/** Constructs a new {@link AutoAmpSequence}. */
public AutoAmpSequence(FieldManagementSubsystem fms,
SwerveSubsystem swerveSubsystem,
ElevatorSubsystem elevatorSubsystem,
IntakePivotSubsystem intakePivotSubsystem,
IntakeRollerSubsystem intakeRollerSubsystem) {

addCommands(
Commands.parallel(
new PrepareAmpSequence(elevatorSubsystem, intakePivotSubsystem, intakeRollerSubsystem),
AlignCommand.getAmpAlignCommand(swerveSubsystem, fms.isRedAlliance())
),
new IntakeRollerOuttakeCommand(intakeRollerSubsystem).withTimeout(1)
);
}
}

0 comments on commit 90b4d66

Please sign in to comment.