This commit is contained in:
Antoine PerreaultE 2024-02-07 18:05:24 -05:00
parent f6f1d52fb1
commit da4342e456

View File

@ -14,36 +14,38 @@ import frc.robot.LimelightHelpers;
public class Limelight extends SubsystemBase { public class Limelight extends SubsystemBase {
/** Creates a new Limelight. */
public Limelight() {
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight");
NetworkTableInstance.getDefault().getTable("limelight").getEntry("Tv").getDouble(0);
NetworkTableInstance.getDefault().getTable("limelight").getEntry("getpipe").getDouble(1);
NetworkTableInstance.getDefault().getTable("limelight").getEntry("").getDoubleArray(new double[6]);
NetworkTableEntry tx = table.getEntry("tx"); NetworkTableEntry tx = table.getEntry("tx");
NetworkTableEntry ty = table.getEntry("ty"); NetworkTableEntry ty = table.getEntry("ty");
NetworkTableEntry ta = table.getEntry("ta"); NetworkTableEntry ta = table.getEntry("ta");
NetworkTableEntry botpose = table.getEntry("pose"); NetworkTableEntry pipeline = table.getEntry("pipeline");
NetworkTableEntry getpipe = table.getEntry(getName()); NetworkTableEntry tv = table.getEntry("tv");
NetworkTableEntry camMode = table.getEntry("camMode");
double x = tx.getDouble(0.0);
double y = ty.getDouble(0.0);
double area = ta.getDouble(0.0);
double pose = botpose.getDouble(area);
/** Creates a new Limelight. */
public Limelight() {
}
public double getx(){
return tx.getDouble(0);
SmartDashboard.putNumber("LimelightX", x); }
SmartDashboard.putNumber("LimelightY", y); public double gety(){
SmartDashboard.putNumber("LimelightArea", area); return ty.getDouble(0);
}
} public double geta() {
return ta.getDouble(0);
}
public boolean getv(){
return tv.getBoolean(false);
}
public double getpipeline(){
return pipeline.getDouble(0);
}
public double getcamMode(){
return camMode.getDouble(0);
}
@Override @Override
public void periodic() { public void periodic() {