case SwerveCompetition: // AKA "Vantage"
case BetaBot: // AKA "Pancake"
- //vision = new Vision(VisionConstants.APRIL_TAG_CAMERAS);
+ // vision = new Vision(VisionConstants.APRIL_TAG_CAMERAS);
// fall-through
case Vivace:
- //linearClimb = new LinearClimb();
+ // linearClimb = new LinearClimb();
case Phil: // AKA "IHOP"
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Intake.Intake;
-import frc.robot.subsystems.shooter.Shooter;
-import frc.robot.subsystems.shooter.ShooterConstants;
import frc.robot.subsystems.spindexer.Spindexer;
public class ReverseMotors extends Command {
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
-import edu.wpi.first.wpilibj.PS5Controller.Button;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.FunctionalCommand;
() -> false, getDrivetrain()).withTimeout(2));
// Trench align
- controller.get(PS5Button.CIRCLE).onTrue(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(true); getDrivetrain().setTrenchAlign(true);}))
- .onFalse(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(false); getDrivetrain().setTrenchAlign(false);}));
-
- controller.get(DPad.LEFT).onTrue(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(true); getDrivetrain().setTrenchAlign(true);}))
- .onFalse(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(false); getDrivetrain().setTrenchAlign(false);}));
+ controller.get(PS5Button.CIRCLE).onTrue(new InstantCommand(() -> {
+ getDrivetrain().setTrenchAssist(true);
+ getDrivetrain().setTrenchAlign(true);
+ }))
+ .onFalse(new InstantCommand(() -> {
+ getDrivetrain().setTrenchAssist(false);
+ getDrivetrain().setTrenchAlign(false);
+ }));
+
+ controller.get(DPad.LEFT).onTrue(new InstantCommand(() -> {
+ getDrivetrain().setTrenchAssist(true);
+ getDrivetrain().setTrenchAlign(true);
+ }))
+ .onFalse(new InstantCommand(() -> {
+ getDrivetrain().setTrenchAssist(false);
+ getDrivetrain().setTrenchAlign(false);
+ }));
// Reverse motors
if (intake != null && spindexer != null && shooter != null) {
double correctionVelocity = pid.calculate(distanceFromSlideLatitude, 0);
- if (distanceFromSlideLatitude < Units.inchesToMeters(3)){
+ if (distanceFromSlideLatitude < Units.inchesToMeters(3)) {
correctionVelocity = 0.0;
}
-
ChassisSpeeds horizontalSpeeds = new ChassisSpeeds(chassisSpeeds.vxMetersPerSecond, correctionVelocity,
chassisSpeeds.omegaRadiansPerSecond);
- var y = new Translation2d(horizontalSpeeds.vxMetersPerSecond, horizontalSpeeds.vyMetersPerSecond).rotateBy(drive.getYaw());
+ var y = new Translation2d(horizontalSpeeds.vxMetersPerSecond, horizontalSpeeds.vyMetersPerSecond)
+ .rotateBy(drive.getYaw());
- var z = ChassisSpeeds.fromFieldRelativeSpeeds(new ChassisSpeeds(y.getX(), y.getY(), horizontalSpeeds.omegaRadiansPerSecond),
+ var z = ChassisSpeeds.fromFieldRelativeSpeeds(
+ new ChassisSpeeds(y.getX(), y.getY(), horizontalSpeeds.omegaRadiansPerSecond),
drive.getYaw());
return z;
new Rectangle2d(new Translation2d(99.99, 99.9), new Translation2d(0.0, 0.0)),
};
- public static final double[] SLIDE_LATITUDES = new double[]{
- FieldConstants.FIELD_WIDTH - Units.inchesToMeters(30.0),
- Units.inchesToMeters(30.0), // should be accurate, i think our field is slightly too small
- // 6.550,
- // 0.668,
+ public static final double[] SLIDE_LATITUDES = new double[] {
+ FieldConstants.FIELD_WIDTH - Units.inchesToMeters(30.0),
+ Units.inchesToMeters(30.0), // should be accurate, i think our field is slightly too small
+ // 6.550,
+ // 0.668,
};