Class LimelightHelpers

java.lang.Object
frc.robot.util.LimelightHelpers

public class LimelightHelpers extends Object
  • Constructor Details

    • LimelightHelpers

      public LimelightHelpers()
  • Method Details

    • getLimelightNTTable

      public static edu.wpi.first.networktables.NetworkTable getLimelightNTTable(String tableName)
    • getLimelightNTTableEntry

      public static edu.wpi.first.networktables.NetworkTableEntry getLimelightNTTableEntry(String tableName, String entryName)
    • getLimelightNTDouble

      public static double getLimelightNTDouble(String tableName, String entryName)
    • setLimelightNTDouble

      public static void setLimelightNTDouble(String tableName, String entryName, double val)
    • setLimelightNTDoubleArray

      public static void setLimelightNTDoubleArray(String tableName, String entryName, double[] val)
    • getLimelightNTDoubleArray

      public static double[] getLimelightNTDoubleArray(String tableName, String entryName)
    • getLimelightNTString

      public static String getLimelightNTString(String tableName, String entryName)
    • getLimelightURLString

      public static URL getLimelightURLString(String tableName, String request)
    • getTX

      public static double getTX(String limelightName)
    • getTY

      public static double getTY(String limelightName)
    • getTA

      public static double getTA(String limelightName)
    • getLatency_Pipeline

      public static double getLatency_Pipeline(String limelightName)
    • getLatency_Capture

      public static double getLatency_Capture(String limelightName)
    • getCurrentPipelineIndex

      public static double getCurrentPipelineIndex(String limelightName)
    • getJSONDump

      public static String getJSONDump(String limelightName)
    • getBotpose

      @Deprecated public static double[] getBotpose(String limelightName)
      Deprecated.
      Switch to getBotPose
      Parameters:
      limelightName -
      Returns:
    • getBotpose_wpiRed

      @Deprecated public static double[] getBotpose_wpiRed(String limelightName)
      Deprecated.
      Switch to getBotPose_wpiRed
      Parameters:
      limelightName -
      Returns:
    • getBotpose_wpiBlue

      @Deprecated public static double[] getBotpose_wpiBlue(String limelightName)
      Deprecated.
      Switch to getBotPose_wpiBlue
      Parameters:
      limelightName -
      Returns:
    • getBotPose

      public static double[] getBotPose(String limelightName)
    • getBotPose_wpiRed

      public static double[] getBotPose_wpiRed(String limelightName)
    • getBotPose_wpiBlue

      public static double[] getBotPose_wpiBlue(String limelightName)
    • getBotPose_TargetSpace

      public static double[] getBotPose_TargetSpace(String limelightName)
    • getCameraPose_TargetSpace

      public static double[] getCameraPose_TargetSpace(String limelightName)
    • getTargetPose_CameraSpace

      public static double[] getTargetPose_CameraSpace(String limelightName)
    • getTargetPose_RobotSpace

      public static double[] getTargetPose_RobotSpace(String limelightName)
    • getTargetColor

      public static double[] getTargetColor(String limelightName)
    • getFiducialID

      public static double getFiducialID(String limelightName)
    • getNeuralClassID

      public static String getNeuralClassID(String limelightName)
    • getBotPose3d

      public static edu.wpi.first.math.geometry.Pose3d getBotPose3d(String limelightName)
    • getBotPose3d_wpiRed

      public static edu.wpi.first.math.geometry.Pose3d getBotPose3d_wpiRed(String limelightName)
    • getBotPose3d_wpiBlue

      public static edu.wpi.first.math.geometry.Pose3d getBotPose3d_wpiBlue(String limelightName)
    • getBotPose3d_TargetSpace

      public static edu.wpi.first.math.geometry.Pose3d getBotPose3d_TargetSpace(String limelightName)
    • getCameraPose3d_TargetSpace

      public static edu.wpi.first.math.geometry.Pose3d getCameraPose3d_TargetSpace(String limelightName)
    • getTargetPose3d_CameraSpace

      public static edu.wpi.first.math.geometry.Pose3d getTargetPose3d_CameraSpace(String limelightName)
    • getTargetPose3d_RobotSpace

      public static edu.wpi.first.math.geometry.Pose3d getTargetPose3d_RobotSpace(String limelightName)
    • getCameraPose3d_RobotSpace

      public static edu.wpi.first.math.geometry.Pose3d getCameraPose3d_RobotSpace(String limelightName)
    • getBotPose2d_wpiBlue

      public static edu.wpi.first.math.geometry.Pose2d getBotPose2d_wpiBlue(String limelightName)
      Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)
      Parameters:
      limelightName -
      Returns:
    • getBotPoseEstimate_wpiBlue

      public static LimelightHelpers.PoseEstimate getBotPoseEstimate_wpiBlue(String limelightName)
      Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the BLUE alliance
      Parameters:
      limelightName -
      Returns:
    • getBotPoseEstimate_wpiBlue_MegaTag2

      public static LimelightHelpers.PoseEstimate getBotPoseEstimate_wpiBlue_MegaTag2(String limelightName)
      Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the BLUE alliance
      Parameters:
      limelightName -
      Returns:
    • getBotPose2d_wpiRed

      public static edu.wpi.first.math.geometry.Pose2d getBotPose2d_wpiRed(String limelightName)
      Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)
      Parameters:
      limelightName -
      Returns:
    • getBotPoseEstimate_wpiRed

      public static LimelightHelpers.PoseEstimate getBotPoseEstimate_wpiRed(String limelightName)
      Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the RED alliance
      Parameters:
      limelightName -
      Returns:
    • getBotPoseEstimate_wpiRed_MegaTag2

      public static LimelightHelpers.PoseEstimate getBotPoseEstimate_wpiRed_MegaTag2(String limelightName)
      Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the RED alliance
      Parameters:
      limelightName -
      Returns:
    • getBotPose2d

      public static edu.wpi.first.math.geometry.Pose2d getBotPose2d(String limelightName)
      Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)
      Parameters:
      limelightName -
      Returns:
    • getTV

      public static boolean getTV(String limelightName)
    • setPipelineIndex

      public static void setPipelineIndex(String limelightName, int pipelineIndex)
    • setPriorityTagID

      public static void setPriorityTagID(String limelightName, int ID)
    • setLEDMode_PipelineControl

      public static void setLEDMode_PipelineControl(String limelightName)
      The LEDs will be controlled by Limelight pipeline settings, and not by robot code.
    • setLEDMode_ForceOff

      public static void setLEDMode_ForceOff(String limelightName)
    • setLEDMode_ForceBlink

      public static void setLEDMode_ForceBlink(String limelightName)
    • setLEDMode_ForceOn

      public static void setLEDMode_ForceOn(String limelightName)
    • setStreamMode_Standard

      public static void setStreamMode_Standard(String limelightName)
    • setStreamMode_PiPMain

      public static void setStreamMode_PiPMain(String limelightName)
    • setStreamMode_PiPSecondary

      public static void setStreamMode_PiPSecondary(String limelightName)
    • setCameraMode_Processor

      public static void setCameraMode_Processor(String limelightName)
    • setCameraMode_Driver

      public static void setCameraMode_Driver(String limelightName)
    • setCropWindow

      public static void setCropWindow(String limelightName, double cropXMin, double cropXMax, double cropYMin, double cropYMax)
      Sets the crop window. The crop window in the UI must be completely open for dynamic cropping to work.
    • SetRobotOrientation

      public static void SetRobotOrientation(String limelightName, double yaw, double yawRate, double pitch, double pitchRate, double roll, double rollRate)
    • SetFiducialIDFiltersOverride

      public static void SetFiducialIDFiltersOverride(String limelightName, int[] validIDs)
    • setCameraPose_RobotSpace

      public static void setCameraPose_RobotSpace(String limelightName, double forward, double side, double up, double roll, double pitch, double yaw)
    • setPythonScriptData

      public static void setPythonScriptData(String limelightName, double[] outgoingPythonData)
    • getPythonScriptData

      public static double[] getPythonScriptData(String limelightName)
    • takeSnapshot

      public static CompletableFuture<Boolean> takeSnapshot(String tableName, String snapshotName)
      Asynchronously take snapshot.
    • getLatestResults

      public static LimelightHelpers.LimelightResults getLatestResults(String limelightName)
      Parses Limelight's JSON results dump into a LimelightResults Object