Package frc.robot.localization
Class CameraProcessor
java.lang.Object
frc.robot.localization.CameraProcessor
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordErr resultsstatic final recordOk resultsstatic interfaceresults tuple -
Constructor Summary
ConstructorsConstructorDescriptionCameraProcessor(CameraConstants cameraConstants) Creates aCameraProcessorfor a fixed (non-turret) camera.CameraProcessor(CameraConstants cameraConstants, @Nullable TurretCameraAdapter adapter) Creates aCameraProcessor, optionally backed by aTurretCameraAdapterfor turreted cameras. -
Method Summary
Modifier and TypeMethodDescriptionprocess(org.photonvision.targeting.PhotonPipelineResult result, ChassisSpeeds currentSpeeds) processes photon results to get robots pose
-
Constructor Details
-
CameraProcessor
Creates aCameraProcessorfor a fixed (non-turret) camera.- Parameters:
cameraConstants- tuning constants for this camera
-
CameraProcessor
Creates aCameraProcessor, optionally backed by aTurretCameraAdapterfor turreted cameras.- Parameters:
cameraConstants- tuning constants for this cameraadapter- turret adapter, ornullif this is a fixed camera
-
-
Method Details
-
process
public CameraProcessor.Result<VisionObservation,RejectionReason> process(org.photonvision.targeting.PhotonPipelineResult result, ChassisSpeeds currentSpeeds) processes photon results to get robots pose- Parameters:
result- photon resultscurrentSpeeds- robot speeds- Returns:
- position data
-