From 3c25b4b39b19962f4670c633fa640363fb4d390f Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Tue, 30 Jan 2024 18:16:02 -0500 Subject: [PATCH] n --- .../java/frc/robot/subsystem/Limelight.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/subsystem/Limelight.java b/src/main/java/frc/robot/subsystem/Limelight.java index e26d582..9fb068b 100644 --- a/src/main/java/frc/robot/subsystem/Limelight.java +++ b/src/main/java/frc/robot/subsystem/Limelight.java @@ -4,20 +4,31 @@ package frc.robot.subsystem; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +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; + public class Limelight extends SubsystemBase { /** Creates a new Limelight. */ public Limelight() { - boolean tv = LimelightHelpers.getTV("No_name"); + NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); + NetworkTableEntry tx = table.getEntry("tx"); + NetworkTableEntry ty = table.getEntry("ty"); + NetworkTableEntry ta = table.getEntry("ta"); + + double x = tx.getDouble(0.0); + double y = ty.getDouble(0.0); + double area = ta.getDouble(0.0); + + SmartDashboard.putNumber("LimelightX", x); + SmartDashboard.putNumber("LimelightY", y); + SmartDashboard.putNumber("LimelightArea", area); - double tx = LimelightHelpers.getTX("No_name"); - double ty = LimelightHelpers.getTY("No_name"); - double ta = LimelightHelpers.getTA("No_name"); }