--- /dev/null
+package frc.robot.commands.gpm;
+
+import edu.wpi.first.wpilibj2.command.Command;
+import edu.wpi.first.wpilibj2.command.InstantCommand;
+import frc.robot.subsystems.Intake.Intake;
+import frc.robot.subsystems.shooter.Shooter;
+import frc.robot.subsystems.shooter.ShooterConstants;
+import frc.robot.subsystems.spindexer.Spindexer;
+import lib.controllers.PS5Controller.PS5Button;
+
+public class ReverseMotors extends Command {
+ // Reverse motors (intake, spindexer, shooter: shoot out constant speed)
+
+ // if (intake != null && spindexer != null && shooter != null){
+ // driver.get(PS5Button.CIRCLE).onTrue(new InstantCommand(() ->{
+ // intake.spinReverse();
+ // // reverse spindexer
+ // shooter.
+ // }))
+ // }
+ private Intake intake;
+ private Spindexer spindexer;
+ private Shooter shooter;
+
+
+ public ReverseMotors(Intake intake, Spindexer spindexer, Shooter shooter){
+ this.intake = intake;
+ this.spindexer = spindexer;
+
+ addRequirements(intake, spindexer, shooter);
+ }
+
+ @Override
+ public void initialize(){
+
+ }
+
+ @Override
+ public void execute(){
+ intake.spinReverse();
+ spindexer.reverseSpindexer();
+ shooter.setShooter(ShooterConstants.SHOOTER_VELOCITY);
+ }
+
+ @Override
+ public void end(boolean interrupted){
+ intake.spinStop();
+ spindexer.stopSpindexer();
+ shooter.setShooter(0);
+ }
+
+}
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.FunctionalCommand;
import edu.wpi.first.wpilibj2.command.InstantCommand;
+import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import frc.robot.Robot;
import frc.robot.commands.gpm.AutoShootCommand;
+import frc.robot.commands.gpm.ReverseMotors;
import frc.robot.constants.Constants;
import frc.robot.subsystems.Climb.LinearClimb;
import frc.robot.subsystems.drivetrain.Drivetrain;
}));
}
+ // Reverse motors
+ if (intake != null && spindexer != null && shooter != null){
+ driver.get(PS5Button.CIRCLE).onTrue(
+ new ReverseMotors(intake, spindexer, shooter)
+ );
+ }
+
// Spindexer
if (spindexer != null){
// Will only run if we are not calling default shoot command
public static final double spindexerVelocityWithBall = 6.0; // rps (for counting balls)
public static final double currentLimit = 40; //A
public static final double spindexerMaxPower = 0.5;
+ public static final double spindexerReversePower = -0.2;
public static final double CURRENT_SPIKE_LIMIT = 80;
public static final double CURRENT_TIME_LIMIT = 1.0; //s
+
}