Antoine PerreaultE 2b94ebcc95 Limelight
2025-02-06 19:08:24 -05:00

40 lines
1.2 KiB
Java

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.subsystems;
import edu.wpi.first.net.PortForwarder;
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 Limelight3 extends SubsystemBase {
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry pipeline = table.getEntry("pipeline");
/** Creates a new Limelight3. */
public Limelight3() {
for(int port = 5800; port <=5807; port++){
PortForwarder.add(port, "limelight.local", port);
}
}
public double getX(){
return LimelightHelpers.getTX("limelight-balon");
}
public boolean getV(){
return LimelightHelpers.getTV("limelight-balon");
}
public void Apriltag(){
pipeline.setNumber(1);
}
public void Forme(){
pipeline.setNumber(0);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}