Limelight

This commit is contained in:
Antoine PerreaultE 2024-02-06 19:57:49 -05:00
parent 83069a3fda
commit 1b6663c977

View File

@ -9,6 +9,7 @@ import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.LimelightHelpers;
@ -17,13 +18,25 @@ public class Limelight extends SubsystemBase {
public 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 getpipe = table.getEntry(getName());
double x = tx.getDouble(0.0); double x = tx.getDouble(0.0);
double y = ty.getDouble(0.0); double y = ty.getDouble(0.0);
double area = ta.getDouble(0.0); double area = ta.getDouble(0.0);
double pose = botpose.getDouble(area);
SmartDashboard.putNumber("LimelightX", x); SmartDashboard.putNumber("LimelightX", x);
SmartDashboard.putNumber("LimelightY", y); SmartDashboard.putNumber("LimelightY", y);