Package frc.robot.vision
Class Limelight2
- java.lang.Object
-
- frc.robot.vision.Limelight2
-
public class Limelight2 extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLimelight2.CameraModestatic classLimelight2.LEDMode
-
Field Summary
Fields Modifier and Type Field Description intusers
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenableVision(boolean on)Switch between vision and driver modedoublegetArea()Get target area [0% to 100%]static Limelight2getInstance()Limelight2.LEDModegetLEDMode()doublegetSkew()Get target skew / rotation [-90 to 0 degrees]LimelightTargetgetTarget()Get the current target, or null if no targetdoublegetXAngle()Get horizontal target angle [from -29.8 t0 29.8 degrees]doublegetYAngle()Get horizontal target angle [from -24.85 to 24.85 degrees]booleanhasTarget()Does the limelight have a target in sight?voidsetCamMode(Limelight2.CameraMode mode)Set the camera stream modevoidsetLED(Limelight2.LEDMode mode)Set the limelight LED modevoidsetPipeline(int pipelineID)Set vision pipeline IDvoidsetPortrait(boolean isPortrait)Set camera portrait modevoiduse(boolean use)
-
-
-
Method Detail
-
getInstance
public static Limelight2 getInstance()
-
use
public void use(boolean use)
-
hasTarget
public boolean hasTarget()
Does the limelight have a target in sight?- Returns:
- Has target
-
getTarget
public LimelightTarget getTarget()
Get the current target, or null if no target- Returns:
- Current target
-
getLEDMode
public Limelight2.LEDMode getLEDMode()
-
getXAngle
public double getXAngle()
Get horizontal target angle [from -29.8 t0 29.8 degrees]- Returns:
- Target angle
-
getYAngle
public double getYAngle()
Get horizontal target angle [from -24.85 to 24.85 degrees]- Returns:
- Target angle
-
getArea
public double getArea()
Get target area [0% to 100%]- Returns:
- Target area
-
getSkew
public double getSkew()
Get target skew / rotation [-90 to 0 degrees]- Returns:
- Target skew
-
setPortrait
public void setPortrait(boolean isPortrait)
Set camera portrait mode- Parameters:
isPortrait- Is camera in portrait mode?
-
setLED
public void setLED(Limelight2.LEDMode mode)
Set the limelight LED mode- Parameters:
mode- LED mode
-
enableVision
public void enableVision(boolean on)
Switch between vision and driver mode- Parameters:
on- Should be vision tracking?
-
setPipeline
public void setPipeline(int pipelineID)
Set vision pipeline ID- Parameters:
pipelineID- Pipeline ID
-
setCamMode
public void setCamMode(Limelight2.CameraMode mode)
Set the camera stream mode- Parameters:
mode- Stream mode
-
-