Package frc.robot.util
Class LimelightHelpers
java.lang.Object
frc.robot.util.LimelightHelpers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]getBotpose(String limelightName) Deprecated.static double[]getBotPose(String limelightName) static double[]getBotPose_TargetSpace(String limelightName) static double[]getBotpose_wpiBlue(String limelightName) Deprecated.static double[]getBotPose_wpiBlue(String limelightName) static double[]getBotpose_wpiRed(String limelightName) Deprecated.static double[]getBotPose_wpiRed(String limelightName) static Pose2dgetBotPose2d(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static Pose2dgetBotPose2d_wpiBlue(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static Pose2dgetBotPose2d_wpiRed(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static Pose3dgetBotPose3d(String limelightName) static Pose3dgetBotPose3d_TargetSpace(String limelightName) static Pose3dgetBotPose3d_wpiBlue(String limelightName) static Pose3dgetBotPose3d_wpiRed(String limelightName) getBotPoseEstimate_wpiBlue(String limelightName) Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the BLUE alliancegetBotPoseEstimate_wpiBlue_MegaTag2(String limelightName) Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the BLUE alliancegetBotPoseEstimate_wpiRed(String limelightName) Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the RED alliancegetBotPoseEstimate_wpiRed_MegaTag2(String limelightName) Gets the Pose2d and timestamp for use with WPILib pose estimator (addVisionMeasurement) when you are on the RED alliancestatic double[]getCameraPose_TargetSpace(String limelightName) static Pose3dgetCameraPose3d_RobotSpace(String limelightName) static Pose3dgetCameraPose3d_TargetSpace(String limelightName) static doublegetCurrentPipelineIndex(String limelightName) static doublegetFiducialID(String limelightName) static StringgetJSONDump(String limelightName) static doublegetLatency_Capture(String limelightName) static doublegetLatency_Pipeline(String limelightName) getLatestResults(String limelightName) Parses Limelight's JSON results dump into a LimelightResults Objectstatic doublegetLimelightNTDouble(String tableName, String entryName) static double[]getLimelightNTDoubleArray(String tableName, String entryName) static StringgetLimelightNTString(String tableName, String entryName) static NetworkTablegetLimelightNTTable(String tableName) static NetworkTableEntrygetLimelightNTTableEntry(String tableName, String entryName) static URLgetLimelightURLString(String tableName, String request) static StringgetNeuralClassID(String limelightName) static double[]getPythonScriptData(String limelightName) static doublestatic double[]getTargetColor(String limelightName) static double[]getTargetPose_CameraSpace(String limelightName) static double[]getTargetPose_RobotSpace(String limelightName) static Pose3dgetTargetPose3d_CameraSpace(String limelightName) static Pose3dgetTargetPose3d_RobotSpace(String limelightName) static booleanstatic doublestatic doublestatic voidsetCameraMode_Driver(String limelightName) static voidsetCameraMode_Processor(String limelightName) static voidsetCameraPose_RobotSpace(String limelightName, double forward, double side, double up, double roll, double pitch, double yaw) static voidsetCropWindow(String limelightName, double cropXMin, double cropXMax, double cropYMin, double cropYMax) Sets the crop window.static voidSetFiducialIDFiltersOverride(String limelightName, int[] validIDs) static voidsetLEDMode_ForceBlink(String limelightName) static voidsetLEDMode_ForceOff(String limelightName) static voidsetLEDMode_ForceOn(String limelightName) static voidsetLEDMode_PipelineControl(String limelightName) The LEDs will be controlled by Limelight pipeline settings, and not by robot code.static voidsetLimelightNTDouble(String tableName, String entryName, double val) static voidsetLimelightNTDoubleArray(String tableName, String entryName, double[] val) static voidsetPipelineIndex(String limelightName, int pipelineIndex) static voidsetPriorityTagID(String limelightName, int ID) static voidsetPythonScriptData(String limelightName, double[] outgoingPythonData) static voidSetRobotOrientation(String limelightName, double yaw, double yawRate, double pitch, double pitchRate, double roll, double rollRate) static voidsetStreamMode_PiPMain(String limelightName) static voidsetStreamMode_PiPSecondary(String limelightName) static voidsetStreamMode_Standard(String limelightName) static CompletableFuture<Boolean>takeSnapshot(String tableName, String snapshotName) Asynchronously take snapshot.
-
Constructor Details
-
LimelightHelpers
public LimelightHelpers()
-
-
Method Details
-
getLimelightNTTable
-
getLimelightNTTableEntry
-
getLimelightNTDouble
-
setLimelightNTDouble
-
setLimelightNTDoubleArray
-
getLimelightNTDoubleArray
-
getLimelightNTString
-
getLimelightURLString
-
getTX
-
getTY
-
getTA
-
getLatency_Pipeline
-
getLatency_Capture
-
getCurrentPipelineIndex
-
getJSONDump
-
getBotpose
Deprecated.Switch to getBotPose- Parameters:
limelightName-- Returns:
-
getBotpose_wpiRed
Deprecated.Switch to getBotPose_wpiRed- Parameters:
limelightName-- Returns:
-
getBotpose_wpiBlue
Deprecated.Switch to getBotPose_wpiBlue- Parameters:
limelightName-- Returns:
-
getBotPose
-
getBotPose_wpiRed
-
getBotPose_wpiBlue
-
getBotPose_TargetSpace
-
getCameraPose_TargetSpace
-
getTargetPose_CameraSpace
-
getTargetPose_RobotSpace
-
getTargetColor
-
getFiducialID
-
getNeuralClassID
-
getBotPose3d
-
getBotPose3d_wpiRed
-
getBotPose3d_wpiBlue
-
getBotPose3d_TargetSpace
-
getCameraPose3d_TargetSpace
-
getTargetPose3d_CameraSpace
-
getTargetPose3d_RobotSpace
-
getCameraPose3d_RobotSpace
-
getBotPose2d_wpiBlue
Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)- Parameters:
limelightName-- Returns:
-
getBotPoseEstimate_wpiBlue
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
Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)- Parameters:
limelightName-- Returns:
-
getBotPoseEstimate_wpiRed
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
Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)- Parameters:
limelightName-- Returns:
-
getTV
-
setPipelineIndex
-
setPriorityTagID
-
setLEDMode_PipelineControl
The LEDs will be controlled by Limelight pipeline settings, and not by robot code. -
setLEDMode_ForceOff
-
setLEDMode_ForceBlink
-
setLEDMode_ForceOn
-
setStreamMode_Standard
-
setStreamMode_PiPMain
-
setStreamMode_PiPSecondary
-
setCameraMode_Processor
-
setCameraMode_Driver
-
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
-
setCameraPose_RobotSpace
public static void setCameraPose_RobotSpace(String limelightName, double forward, double side, double up, double roll, double pitch, double yaw) -
setPythonScriptData
-
getPythonScriptData
-
takeSnapshot
Asynchronously take snapshot. -
getLatestResults
Parses Limelight's JSON results dump into a LimelightResults Object
-