Package frc.spectrumLib.vision
Class Limelight
java.lang.Object
frc.spectrumLib.vision.Limelight
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSet LL LED's to blinkdoubledoubledoublegetDistanceToTarget(double targetHeight) get distance in meters to a targetdoubleedu.wpi.first.math.geometry.Pose3ddoubleReturns the timestamp of the MEGATAG1 pose estimation from the Limelight camera.edu.wpi.first.math.geometry.Pose2ddoubleReturns the timestamp of the MEGATAG2 pose estimation from the Limelight camera.getName()doubleDeprecated, for removal: This API element is subject to removal in a future version.doubledoubledoublegetTagTA()doublegetTagTx()doubledoublebooleanbooleanbooleanChecks if the camera is connected by looking for an empty botpose array from camera.booleanbooleanvoidPrints the vision, estimated, and odometry pose to SmartDashboardvoidsendInvalidStatus(String message) voidsendValidStatus(String message) voidsetIMUmode(int mode) setIntegrating(boolean isIntegrating) voidsetLEDMode(boolean enabled) Sets the LED mode of the LL.voidsetLimelightPipeline(int pipelineIndex) setLogStatus(String logStatus) voidsetRobotOrientation(double degrees) voidsetRobotOrientation(double degrees, double angularRate) setTagStatus(String tagStatus) boolean
-
Constructor Details
-
Limelight
-
Limelight
-
Limelight
-
Limelight
-
Limelight
-
-
Method Details
-
getName
-
isAttached
public boolean isAttached() -
getHorizontalOffset
public double getHorizontalOffset()- Returns:
- Horizontal Offset From Crosshair To Target (LL1: -27 degrees to 27 degrees / LL2: -29.8 to 29.8 degrees)
-
getVerticalOffset
public double getVerticalOffset()- Returns:
- Vertical Offset From Crosshair To Target in degrees (LL1: -20.5 degrees to 20.5 degrees / LL2: -24.85 to 24.85 degrees)
-
targetInView
public boolean targetInView()- Returns:
- Whether the LL has any valid targets (April tags or other vision targets)
-
multipleTagsInView
public boolean multipleTagsInView()- Returns:
- whether the LL sees multiple tags or not
-
getTagCountInView
public double getTagCountInView() -
getClosestTagID
public double getClosestTagID()- Returns:
- the tag ID of the apriltag most centered in the LL's view (or based on different criteria set in LL dasbhoard)
-
getTargetSize
public double getTargetSize() -
getMegaTag1_Pose3d
public edu.wpi.first.math.geometry.Pose3d getMegaTag1_Pose3d()- Returns:
- the corresponding LL Pose3d (MEGATAG1) for the alliance in DriverStation.java
-
getMegaTag2_Pose2d
public edu.wpi.first.math.geometry.Pose2d getMegaTag2_Pose2d()- Returns:
- the corresponding LL Pose3d (MEGATAG2) for the alliance in DriverStation.java
-
getMegaTag1_PoseEstimate
-
getMegaTag2_PoseEstimate
-
hasAccuratePose
public boolean hasAccuratePose() -
getDistanceToTagFromCamera
public double getDistanceToTagFromCamera()- Returns:
- the distance of the 2d vector from the camera to closest apriltag
-
getRawFiducial
-
getMegaTag1PoseTimestamp
public double getMegaTag1PoseTimestamp()Returns the timestamp of the MEGATAG1 pose estimation from the Limelight camera.- Returns:
- The timestamp of the pose estimation in seconds.
-
getMegaTag2PoseTimestamp
public double getMegaTag2PoseTimestamp()Returns the timestamp of the MEGATAG2 pose estimation from the Limelight camera.- Returns:
- The timestamp of the pose estimation in seconds.
-
getPoseLatency
Deprecated, for removal: This API element is subject to removal in a future version.Returns the latency of the pose estimation from the Limelight camera.- Returns:
- The latency of the pose estimation in seconds.
-
getDistanceToTarget
public double getDistanceToTarget(double targetHeight) get distance in meters to a target- Parameters:
targetHeight- meters- Returns:
-
sendValidStatus
-
sendInvalidStatus
-
setLimelightPipeline
public void setLimelightPipeline(int pipelineIndex) - Parameters:
pipelineIndex- use pipeline indexes inVision.VisionConfig
-
setRobotOrientation
public void setRobotOrientation(double degrees) -
setRobotOrientation
public void setRobotOrientation(double degrees, double angularRate) -
setIMUmode
public void setIMUmode(int mode) -
getTagTx
public double getTagTx() -
getTagTA
public double getTagTA() -
getTagRotationDegrees
public double getTagRotationDegrees() -
setLEDMode
public void setLEDMode(boolean enabled) Sets the LED mode of the LL.- Parameters:
enabled- true to enable the LED mode, false to disable it
-
blinkLEDs
public void blinkLEDs()Set LL LED's to blink -
isCameraConnected
public boolean isCameraConnected()Checks if the camera is connected by looking for an empty botpose array from camera. -
printDebug
public void printDebug()Prints the vision, estimated, and odometry pose to SmartDashboard -
isIntegrating
public boolean isIntegrating() -
setIntegrating
- Returns:
this.
-
getCameraName
-
getLogStatus
-
setLogStatus
- Returns:
this.
-
getTagStatus
-
setTagStatus
- Returns:
this.
-