]> git.taranathan.com Git - FRC2026.git/commitdiff
merge run spindexer branch in
authormoo <moogoesmeow123@gmail.com>
Sun, 8 Mar 2026 17:34:21 +0000 (10:34 -0700)
committermoo <moogoesmeow123@gmail.com>
Sun, 8 Mar 2026 17:34:21 +0000 (10:34 -0700)
1  2 
src/main/java/frc/robot/RobotContainer.java

index cfa798b075500ff2d042622292972ef86f7ad28d,12880ee141f768d47210a372d3b6609383258c2a..2fd4358c94e005b57bce02236c93292cfaf75be8
@@@ -193,41 -194,38 +194,54 @@@ public class RobotContainer 
          drive);
    }
  
 +  private boolean seizing;
 +
    public void registerCommands() {
 -    if (intake != null){
 -      NamedCommands.registerCommand("Extend Intake", new InstantCommand(()-> intake.extend()));
 -      NamedCommands.registerCommand("Retract Intake", new InstantCommand(()-> intake.retract()));
 +    if (intake != null) {
 +      NamedCommands.registerCommand("Extend Intake", new InstantCommand(() -> intake.extend()));
 +      NamedCommands.registerCommand("Retract Intake", new InstantCommand(() -> intake.retract()));
 +      NamedCommands.registerCommand("Intermediate Extend", new InstantCommand(() -> intake.intermediateExtend()));
 +      NamedCommands.registerCommand("Spin Intake Rollers", new InstantCommand(() -> intake.spinStart()));
 +      NamedCommands.registerCommand("Stop Intake Rollers", new InstantCommand(() -> intake.spinStop()));
 +
 +      NamedCommands.registerCommand("Start Intake Seizure", new InstantCommand(() -> {
 +        seizing = true;
 +        CommandScheduler.getInstance().schedule(new IntakeMovementCommand(intake).until(() -> !seizing));
 +      }));
 +      NamedCommands.registerCommand("Stop Intake Seizure", new InstantCommand(() -> {
 +        seizing = false;
 +      }));
      }
  
-     if (turret != null && drive != null && hood != null && shooter != null && spindexer != null) {
+     if (intake != null && spindexer != null){ 
+       NamedCommands.registerCommand("Spin Intake Rollers", new ParallelCommandGroup(
+         new InstantCommand(()->intake.spin(IntakeConstants.SPEED))
+       ));
+       NamedCommands.registerCommand("Stop Intake Rollers", new ParallelCommandGroup(
+         new InstantCommand(()->intake.spinStop())
+       ));
+       Command intakeMovement = new IntakeMovementCommand(intake);
+       NamedCommands.registerCommand("Start Intake Seizure", new InstantCommand(()-> intakeMovement.schedule()));
+       NamedCommands.registerCommand("Stop Intake Seizure", new InstantCommand(()-> intakeMovement.cancel()));
+     }
+     if (turret != null && drive != null && hood != null && shooter != null && spindexer != null){
+       Command runSpindexer = new RunSpindexer(spindexer, turret);
        NamedCommands.registerCommand("Auto shoot", new AutoShootCommand(turret, drive, hood, shooter, spindexer));
-       NamedCommands.registerCommand("Start Spindexer", new InstantCommand(() -> spindexer.maxSpindexer(), spindexer));
-       NamedCommands.registerCommand("Stop Spindexer", new InstantCommand(() -> spindexer.stopSpindexer()));
+       NamedCommands.registerCommand("Start Spindexer", new InstantCommand(() -> runSpindexer.schedule()));
+       NamedCommands.registerCommand("Stop Spindexer", new InstantCommand(() -> runSpindexer.cancel()));
      }
  
 -    if (hood != null){
 -      NamedCommands.registerCommand("Hood Down", new InstantCommand(()->{hood.forceHoodDown(true);}));
 -      NamedCommands.registerCommand("Stop Hood Down", new InstantCommand(()-> {hood.forceHoodDown(false);}));
 +    if (hood != null) {
 +      NamedCommands.registerCommand("Hood Down", new InstantCommand(() -> {
 +        hood.forceHoodDown(true);
 +      }));
 +      NamedCommands.registerCommand("Stop Hood Down", new InstantCommand(() -> {
 +        hood.forceHoodDown(false);
 +      }));
      }
  
 -
 -    if (linearClimb != null && drive != null){
 +    if (linearClimb != null && drive != null) {
        NamedCommands.registerCommand("Climb", new ClimbDriveCommand(linearClimb, drive));
      }