Skip to content

Commit

Permalink
auto-stows after amping
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticalApple committed Apr 5, 2024
1 parent 0a863b0 commit 82cbe98
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/frc/robot/commands/auton/AutoAmpSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.elevator.ElevatorToZeroCommand;
import frc.robot.commands.intake.pivot.IntakePivotSetPositionCommand;
import frc.robot.commands.intake.roller.IntakeRollerOuttakeCommand;
import frc.robot.commands.sequences.PrepareAmpSequence;
import frc.robot.commands.swerve.AlignCommand;
Expand All @@ -11,8 +13,10 @@
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). */
/**
* 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}. */
Expand All @@ -23,11 +27,20 @@ public AutoAmpSequence(FieldManagementSubsystem fms,
IntakeRollerSubsystem intakeRollerSubsystem) {

addCommands(
/* Prepares the mechanisms for amping while path-finding the robot to its amping position. */
Commands.parallel(
new PrepareAmpSequence(elevatorSubsystem, intakePivotSubsystem, intakeRollerSubsystem),
AlignCommand.getAmpAlignCommand(swerveSubsystem, fms.isRedAlliance())
),
new IntakeRollerOuttakeCommand(intakeRollerSubsystem).withTimeout(1)

/* Deposits the note into the amp. */
new IntakeRollerOuttakeCommand(intakeRollerSubsystem).withTimeout(1),

/* Retracts the intake and lowers the elevator, resetting the robot to its stowed state.*/
Commands.parallel(
new IntakePivotSetPositionCommand(intakePivotSubsystem, 0),
new ElevatorToZeroCommand(elevatorSubsystem)
)
);
}
}

0 comments on commit 82cbe98

Please sign in to comment.