Limelight
This commit is contained in:
parent
83069a3fda
commit
1b6663c977
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -16,14 +17,26 @@ public class Limelight extends SubsystemBase {
|
|||||||
/** Creates a new Limelight. */
|
/** Creates a new Limelight. */
|
||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user