From 1b6663c9771e55d16b3c50134c6dfb15f33c5b48 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Tue, 6 Feb 2024 19:57:49 -0500 Subject: [PATCH] Limelight --- src/main/java/frc/robot/subsystem/Limelight.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystem/Limelight.java b/src/main/java/frc/robot/subsystem/Limelight.java index 9fb068b..176616d 100644 --- a/src/main/java/frc/robot/subsystem/Limelight.java +++ b/src/main/java/frc/robot/subsystem/Limelight.java @@ -9,6 +9,7 @@ import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.LimelightHelpers; @@ -16,14 +17,26 @@ 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 ty = table.getEntry("ty"); NetworkTableEntry ta = table.getEntry("ta"); + NetworkTableEntry botpose = table.getEntry("pose"); + NetworkTableEntry getpipe = table.getEntry(getName()); double x = tx.getDouble(0.0); double y = ty.getDouble(0.0); double area = ta.getDouble(0.0); + double pose = botpose.getDouble(area); + + + + SmartDashboard.putNumber("LimelightX", x); SmartDashboard.putNumber("LimelightY", y);