// 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 org.photonvision.PhotonCamera; import org.photonvision.common.hardware.VisionLEDMode; import edu.wpi.first.net.PortForwarder; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Limelight extends SubsystemBase { PhotonCamera limelight = new PhotonCamera("limelight"); /** Creates a new Limelight. */ public Limelight() { PortForwarder.add(5800, "photonvision.local", 5800); } public void cube() { limelight.setLED(VisionLEDMode.kOff); limelight.setPipelineIndex(3); } public void cone() { limelight.setLED(VisionLEDMode.kOff); limelight.setPipelineIndex(2); } public void apriltag() { limelight.setLED(VisionLEDMode.kOff); limelight.setPipelineIndex(0); } public void tape() { limelight.setLED(VisionLEDMode.kOn); limelight.setPipelineIndex(1); } @Override public void periodic() { // This method will be called once per scheduler run } }