Class LimelightIO

java.lang.Object
frc.robot.subsystems.vision.LimelightIO
All Implemented Interfaces:
PoseSourceIO

public class LimelightIO extends Object implements 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.