Package frc.robot.vision
Class TargetTracker
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.SubsystemBase
-
- frc.robot.vision.TargetTracker
-
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable
,edu.wpi.first.wpilibj2.command.Subsystem
public class TargetTracker extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableTargetChecking(boolean on)
Should target checking be enabled? When on, the limelight will briefly flash once every second and check for goals.static TargetTracker
getInstance()
LimelightTarget
getLastSnapshot()
Get the latest target checking snapshotLimelightTarget
getTarget()
Return the current viewed target, or null if vision is disabled, or there is no target to be foundvoid
periodic()
-
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
-
-
-
-
Method Detail
-
getInstance
public static TargetTracker getInstance()
-
periodic
public void periodic()
-
enableTargetChecking
public void enableTargetChecking(boolean on)
Should target checking be enabled? When on, the limelight will briefly flash once every second and check for goals.- Parameters:
on
- Enable target checking?
-
getLastSnapshot
public LimelightTarget getLastSnapshot()
Get the latest target checking snapshot- Returns:
- Latest snapshot
-
getTarget
public LimelightTarget getTarget()
Return the current viewed target, or null if vision is disabled, or there is no target to be found- Returns:
- Current target
-
-