Package frc.robot.util
Class LimelightHelpers
java.lang.Object
frc.robot.util.LimelightHelpers
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static class
static class
static class
-
Constructor Summary
-
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 edu.wpi.first.math.geometry.Pose2d
getBotPose2d
(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static edu.wpi.first.math.geometry.Pose2d
getBotPose2d_wpiBlue
(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static edu.wpi.first.math.geometry.Pose2d
getBotPose2d_wpiRed
(String limelightName) Gets the Pose2d for easy use with Odometry vision pose estimator (addVisionMeasurement)static edu.wpi.first.math.geometry.Pose3d
getBotPose3d
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getBotPose3d_TargetSpace
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getBotPose3d_wpiBlue
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getBotPose3d_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 edu.wpi.first.math.geometry.Pose3d
getCameraPose3d_RobotSpace
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getCameraPose3d_TargetSpace
(String limelightName) static double
getCurrentPipelineIndex
(String limelightName) static double
getFiducialID
(String limelightName) static String
getJSONDump
(String limelightName) static double
getLatency_Capture
(String limelightName) static double
getLatency_Pipeline
(String limelightName) getLatestResults
(String limelightName) Parses Limelight's JSON results dump into a LimelightResults Objectstatic double
getLimelightNTDouble
(String tableName, String entryName) static double[]
getLimelightNTDoubleArray
(String tableName, String entryName) static String
getLimelightNTString
(String tableName, String entryName) static edu.wpi.first.networktables.NetworkTable
getLimelightNTTable
(String tableName) static edu.wpi.first.networktables.NetworkTableEntry
getLimelightNTTableEntry
(String tableName, String entryName) static URL
getLimelightURLString
(String tableName, String request) static String
getNeuralClassID
(String limelightName) static double[]
getPythonScriptData
(String limelightName) static double
static double[]
getTargetColor
(String limelightName) static double[]
getTargetPose_CameraSpace
(String limelightName) static double[]
getTargetPose_RobotSpace
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getTargetPose3d_CameraSpace
(String limelightName) static edu.wpi.first.math.geometry.Pose3d
getTargetPose3d_RobotSpace
(String limelightName) static boolean
static double
static double
static void
setCameraMode_Driver
(String limelightName) static void
setCameraMode_Processor
(String limelightName) static void
setCameraPose_RobotSpace
(String limelightName, double forward, double side, double up, double roll, double pitch, double yaw) static void
setCropWindow
(String limelightName, double cropXMin, double cropXMax, double cropYMin, double cropYMax) Sets the crop window.static void
SetFiducialIDFiltersOverride
(String limelightName, int[] validIDs) static void
setLEDMode_ForceBlink
(String limelightName) static void
setLEDMode_ForceOff
(String limelightName) static void
setLEDMode_ForceOn
(String limelightName) static void
setLEDMode_PipelineControl
(String limelightName) The LEDs will be controlled by Limelight pipeline settings, and not by robot code.static void
setLimelightNTDouble
(String tableName, String entryName, double val) static void
setLimelightNTDoubleArray
(String tableName, String entryName, double[] val) static void
setPipelineIndex
(String limelightName, int pipelineIndex) static void
setPriorityTagID
(String limelightName, int ID) static void
setPythonScriptData
(String limelightName, double[] outgoingPythonData) static void
SetRobotOrientation
(String limelightName, double yaw, double yawRate, double pitch, double pitchRate, double roll, double rollRate) static void
setStreamMode_PiPMain
(String limelightName) static void
setStreamMode_PiPSecondary
(String limelightName) static void
setStreamMode_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
-