package org.usfirst.frc.team3501.robot.commands.shooter;
+import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.CommandGroup;
public boolean usePhotogate;
+ /**
+ * Fires catapult, then resets after a pause. If robot is set to use photogate
+ * and no ball is detected, nothing happens.
+ *
+ * Precondition: catapult is in reset position, and ball is loaded in
+ * catapult.
+ */
public Shoot() {
- addSequential(new WaitCommand(3.0));
- addSequential(new runShooter());
- addSequential(new WaitCommand(3.0));
if (Robot.shooter.usePhotogate()) {
if (Robot.shooter.isBallInside()) {
- addSequential(new ExtendPunch());
- addSequential(new WaitCommand(5.0));
- addSequential(new RetractPunch());
+ addSequential(new FireCatapult());
+ addSequential(new WaitCommand(Constants.Shooter.WAIT_TIME));
+ addSequential(new ResetCatapult());
}
} else {
- addSequential(new ExtendPunch());
- addSequential(new WaitCommand(5.0));
- addSequential(new RetractPunch());
+ addSequential(new FireCatapult());
+ addSequential(new WaitCommand(Constants.Shooter.WAIT_TIME));
+ addSequential(new ResetCatapult());
}
-
}
}