Limelight 3d (j'ai peur)
This commit is contained in:
@@ -48,12 +48,12 @@ public class AprilTag3 extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
double a = limelight3.getTx();
|
double a = limelight3.getTx();
|
||||||
double b = limelight3.getRx();
|
double b = limelight3.getTA()*100/Math.cos(90-limelight3.getTx());
|
||||||
if(limelight3.getV() == true){
|
if(limelight3.getV() == true){
|
||||||
drivetrain.setControl(drive.
|
drivetrain.setControl(drive.
|
||||||
withRotationalRate(a/10).
|
withRotationalRate(a/10).
|
||||||
withVelocityX(0).
|
withVelocityX(0).
|
||||||
withVelocityY(b/10));
|
withVelocityY( b/30));
|
||||||
System.out.println(b/10);
|
System.out.println(b/10);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ public class Limelight3 extends SubsystemBase {
|
|||||||
NetworkTableEntry tx = table.getEntry("tx");
|
NetworkTableEntry tx = table.getEntry("tx");
|
||||||
return tx.getDouble(0.0);
|
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(){
|
public double getRx(){
|
||||||
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
||||||
NetworkTableEntry rx = table.getEntry("rx");
|
NetworkTableEntry rx = table.getEntry("rx");
|
||||||
|
|||||||
Reference in New Issue
Block a user