Limelight 3d (j'ai peur)

This commit is contained in:
Samuel
2025-10-29 18:44:15 -04:00
parent 40898dccf9
commit 299e1f8914
2 changed files with 7 additions and 2 deletions

View File

@@ -48,12 +48,12 @@ public class AprilTag3 extends Command {
@Override
public void execute() {
double a = limelight3.getTx();
double b = limelight3.getRx();
double b = limelight3.getTA()*100/Math.cos(90-limelight3.getTx());
if(limelight3.getV() == true){
drivetrain.setControl(drive.
withRotationalRate(a/10).
withVelocityX(0).
withVelocityY(b/10));
withVelocityY( b/30));
System.out.println(b/10);
}
else{

View File

@@ -25,6 +25,11 @@ public class Limelight3 extends SubsystemBase {
NetworkTableEntry tx = table.getEntry("tx");
return tx.getDouble(0.0);
}
public double getTA(){
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry ta = table.getEntry("ta");
return ta.getDouble(0.0);
}
public double getRx(){
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry rx = table.getEntry("rx");