Package limelight
Class Limelight
java.lang.Object
limelight.Limelight
Limelight Camera class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flush the NetworkTable data to server.getData()Get theLimelightDataobject for theLimelightGets the latest JSONLimelightResultsoutput and returns a LimelightResults object.Get theNetworkTablefor this limelight.getPoseEstimator(boolean megatag2) Create aLimelightPoseEstimatorfor theLimelight.Get theLimelightSettingspreparatory to changing settings.static booleanisAvailable(String limelightName) Verify limelight name exists as a table in NT.voidAsynchronously take a snapshot in limelight.
-
Field Details
-
limelightName
Limelightname.
-
-
Constructor Details
-
Limelight
Constructs and configures theLimelightNT Values.- Parameters:
name- Name of the limelight
-
-
Method Details
-
isAvailable
Verify limelight name exists as a table in NT.This check is expected to be run once during robot construction and is not intended to be checked in the iterative loop.
Use check "yourLimelightObject.getData().targetData.getTargetStatus())"" for the validity of an iteration for 2d targeting.
For valid 3d pose check "yourLimelightPoseEstimatorObject.getPoseEstimate().get().hasData"
- Parameters:
limelightName- Limelight Name to check for table existence.- Returns:
- true if an NT table exists with requested LL name.
false and issues a WPILib Error Alert if requested LL doesn't appear as an NT table.
-
getPoseEstimator
Create aLimelightPoseEstimatorfor theLimelight.- Parameters:
megatag2- Use MegaTag2.- Returns:
LimelightPoseEstimator
-
getSettings
Get theLimelightSettingspreparatory to changing settings.While this method does get current settings from the LL there are no getters provided for the settings so they are useless, dead data. This merely provides a stub for the various ".withXXXX" settings to attach to.
This method may be used as often as needed and may contain none or more chained ".withXXXX" settings.
- Returns:
- object used as the target of the various ".withXXXX" settings methods.
-
getData
Get theLimelightDataobject for theLimelight- Returns:
LimelightDataobject.
-
snapshot
Asynchronously take a snapshot in limelight.- Parameters:
snapshotname- Snapshot name to save.
-
getLatestResults
Gets the latest JSONLimelightResultsoutput and returns a LimelightResults object.- Returns:
- LimelightResults object containing all current target data
-
flush
public void flush()Flush the NetworkTable data to server. -
getNTTable
Get theNetworkTablefor this limelight.- Returns:
NetworkTablefor this limelight.
-