This commit is contained in:
samuel desharnais 2024-01-30 19:52:11 -05:00
commit 33990971eb

View File

@ -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");
}