Class LimelightIO
java.lang.Object
frc.robot.subsystems.vision.LimelightIO
- All Implemented Interfaces:
PoseSourceIO
Reads one Limelight's MegaTag1 or MegaTag2 estimate into
PoseSourceInputs.
Each Limelight is two sources, <camera>/MT1 and <camera>/MT2, so the two
algorithms get separate shadow tracks and can be compared frame for frame. Both IOs share one
Limelight, which caches its NetworkTables reads per loop (Limelight.invalidate()
is called once per loop by Vision).
A frame is reported once: an estimate whose timestamp matches the last one reported is the same camera frame read again, and is skipped. Fusing the same frame twice would overweight it.
MegaTag2 only publishes a 2-D pose, so its observation carries the same frame's MegaTag1 height, roll and pitch, as the offseason code did. That way the tilt and height gates see a knocked camera or bad solve whichever algorithm is being fused.
-
Field Summary
Fields inherited from interface PoseSourceIO
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidupdateInputs(PoseSourceInputs inputs) Fillsinputswith everything reported since the last call.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PoseSourceIO
derived
-
Constructor Details
-
LimelightIO
- Parameters:
limelight- the camerakind-PoseObservation.Kind.LIMELIGHT_MT1orPoseObservation.Kind.LIMELIGHT_MT2
-
-
Method Details
-
updateInputs
Description copied from interface:PoseSourceIOFillsinputswith everything reported since the last call.- Specified by:
updateInputsin interfacePoseSourceIO- Parameters:
inputs- the inputs to overwrite
-