This commit is contained in:
samuel desharnais
2026-03-28 20:50:33 -04:00
parent 755d79aa18
commit 673a7fcb82
7 changed files with 43 additions and 38 deletions

View File

@@ -53,16 +53,15 @@ public class LimelighterAuto extends Command {
@Override
public void execute() {
double[] BotPose = new double[6];
System.out.println("a");
if (limelight3g.getV()) {
if(alliance.isPresent()){
if(!alliance.isPresent()){return;}
if(alliance.get() == Alliance.Blue){
BotPose = limelight3g.getBotPoseBlue();
}
else{
BotPose = limelight3g.getBotPoseRed();
}
}
botx = BotPose[1];
boty = BotPose[0];
angle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
@@ -72,8 +71,9 @@ public class LimelighterAuto extends Command {
calcul = limelight3g.Calcule(botx, 4, boty, 4.6, angle) / 5;
drivetrain.setControl(
drive.withVelocityX(0).withVelocityY(0).withRotationalRate(calcul));
System.out.println("Limelighter");
System.out.println(calcul);
if (calcul < 0.1 && calcul > -0.1) {
if (calcul < 0.3 && calcul > -0.3) {
drivetrain.setControl(drive.withRotationalRate(0));
}
}
@@ -92,7 +92,7 @@ public class LimelighterAuto extends Command {
// Returns true when the command should end.
@Override
public boolean isFinished() {
return calcul < 0.1 && calcul > -0.1;
return calcul < 0.3 && calcul > -0.3;
}
}