mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-09 08:48:04 -06:00
Auto align Consistency improvements
This commit is contained in:
@@ -10,7 +10,7 @@ import edu.wpi.first.wpilibj.DriverStation;
|
||||
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc4388.robot.Constants.SwerveDriveConstants.AutoConstants;
|
||||
import frc4388.robot.Constants.AutoConstants;
|
||||
import frc4388.robot.subsystems.SwerveDrive;
|
||||
import frc4388.robot.subsystems.Vision;
|
||||
import frc4388.utility.Gains;
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package frc4388.robot.commands;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.Commands;
|
||||
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||
|
||||
// Command that is called if something is true
|
||||
public class IfCommand extends InstantCommand {
|
||||
BooleanSupplier isTrue;
|
||||
Command trueCommand;
|
||||
Command falseCommand;
|
||||
|
||||
public IfCommand(BooleanSupplier isTrue, Command trueCommand, Command falseCommand){
|
||||
this.isTrue = isTrue;
|
||||
this.trueCommand = trueCommand;
|
||||
this.falseCommand = falseCommand;
|
||||
}
|
||||
|
||||
public IfCommand(BooleanSupplier isTrue, Command trueCommand){
|
||||
this(isTrue, trueCommand, Commands.none());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if(isTrue.getAsBoolean())
|
||||
trueCommand.schedule();
|
||||
else
|
||||
falseCommand.schedule();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user