vgft
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user