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 class
Limelight2.CameraMode
static class
Limelight2.LEDMode
-
Field Summary
Fields Modifier and Type Field Description int
users
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableVision(boolean on)
Switch between vision and driver modedouble
getArea()
Get target area [0% to 100%]static Limelight2
getInstance()
Limelight2.LEDMode
getLEDMode()
double
getSkew()
Get target skew / rotation [-90 to 0 degrees]LimelightTarget
getTarget()
Get the current target, or null if no targetdouble
getXAngle()
Get horizontal target angle [from -29.8 t0 29.8 degrees]double
getYAngle()
Get horizontal target angle [from -24.85 to 24.85 degrees]boolean
hasTarget()
Does the limelight have a target in sight?void
setCamMode(Limelight2.CameraMode mode)
Set the camera stream modevoid
setLED(Limelight2.LEDMode mode)
Set the limelight LED modevoid
setPipeline(int pipelineID)
Set vision pipeline IDvoid
setPortrait(boolean isPortrait)
Set camera portrait modevoid
use(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
-
-