Class CameraProcessor

java.lang.Object
frc.robot.localization.CameraProcessor

public class CameraProcessor extends Object
Filters a PhotonPipelineResult and, when the result passes all quality checks, produces a VisionObservation ready for fusion into DrivetrainState.

This class is stateless with respect to the robot pose it only decides whether a camera frame is trustworthy and computes the appropriate standard deviations. Pose-estimator mutations remain the exclusive responsibility of DrivetrainState.

For fixed cameras, use the single-argument constructor. For turreted cameras, supply a TurretCameraAdapter that is kept up to date with turret angle samples by the Turret subsystem.

  • Constructor Details

    • CameraProcessor

      public CameraProcessor(CameraConstants cameraConstants)
      Creates a CameraProcessor for a fixed (non-turret) camera.
      Parameters:
      cameraConstants - tuning constants for this camera
    • CameraProcessor

      public CameraProcessor(CameraConstants cameraConstants, @Nullable TurretCameraAdapter adapter)
      Creates a CameraProcessor, optionally backed by a TurretCameraAdapter for turreted cameras.
      Parameters:
      cameraConstants - tuning constants for this camera
      adapter - turret adapter, or null if this is a fixed camera
  • Method Details