Package frc.spectrumLib.vision
Class VisionLogger
java.lang.Object
frc.spectrumLib.vision.VisionLogger
Logs telemetry data from a
Limelight camera to the robot's data-logging system (DogLog)
under the Vision/<name>/ namespace.
Each method reads the corresponding value from the camera, forwards it to Telemetry.log(edu.wpi.first.wpilibj2.command.Command), and also returns the value so callers can use it
directly without a second camera query.
-
Constructor Summary
ConstructorsConstructorDescriptionVisionLogger(String name, Limelight limelight) Constructs a logger for the given Limelight camera. -
Method Summary
Modifier and TypeMethodDescriptionbooleanLogs and returns whether the camera is currently connected.booleanLogs and returns whether pose measurements are currently being fused into the estimator.Logs and returns the camera's human-readable integration status message.Logs and returns the robot's 2-D pose from the MegaTag2 (heading-fused) estimate.getName()Namespace prefix used in all telemetry keys (Vision/<name>/...).getPose()Logs and returns the robot's 2-D pose derived from the MegaTag1 estimate.doubleLogs and returns the number of AprilTags contributing to the current pose estimate.Logs and returns the camera's human-readable tag-detection status message.doubleLogs and returns the area of the primary target as a percentage of the camera image.
-
Constructor Details
-
VisionLogger
Constructs a logger for the given Limelight camera.- Parameters:
name- the namespace prefix used in telemetry keyslimelight- the camera to read from
-
-
Method Details
-
getCameraConnection
public boolean getCameraConnection()Logs and returns whether the camera is currently connected.- Returns:
trueif the camera is reachable over the network
-
getIntegratingStatus
public boolean getIntegratingStatus()Logs and returns whether pose measurements are currently being fused into the estimator.- Returns:
trueif the camera is actively integrating
-
getLogStatus
Logs and returns the camera's human-readable integration status message.- Returns:
- the current log status string from the camera
-
getTagStatus
Logs and returns the camera's human-readable tag-detection status message.- Returns:
- the current tag status string from the camera
-
getPose
Logs and returns the robot's 2-D pose derived from the MegaTag1 estimate.- Returns:
- the MegaTag1 pose projected to 2-D in the WPILib Blue origin frame
-
getMegaPose
Logs and returns the robot's 2-D pose from the MegaTag2 (heading-fused) estimate.- Returns:
- the MegaTag2
Pose2din the WPILib Blue origin frame
-
getTagCount
public double getTagCount()Logs and returns the number of AprilTags contributing to the current pose estimate.- Returns:
- the tag count from the MegaTag1 estimate
-
getTargetSize
public double getTargetSize()Logs and returns the area of the primary target as a percentage of the camera image.- Returns:
- target area (0–100 %)
-
getName
Namespace prefix used in all telemetry keys (Vision/<name>/...).
-