Class Vision

All Implemented Interfaces:
Sendable, Subsystem

@NullMarked public class Vision extends SubsystemBase
Vision subsystem responsible for processing camera-based pose observations and contributing vision measurements to the drivetrain pose estimator.

This subsystem acts as a bridge between one or more vision pipelines (e.g. PhotonVision) and the SwerveState pose estimator.

Timestamp handling

Vision measurements are frequently delayed relative to the control loop. This subsystem ensures measurements are applied in chronological order so that the pose estimator can correctly replay history using its internal pose buffer.

Multiple cameras

The subsystem supports an arbitrary number of cameras, each with its own calibration and transform defined in Constants.Vision.cameraConstants. All cameras contribute measurements into a single shared pose estimate.

Visualization

For debugging and analysis, the subsystem publishes 3D visualization data showing the relationship between the robot, cameras, and observed AprilTags. This data is intended for tools such as AdvantageScope and is not used for control.
  • Constructor Details

    • Vision

      public Vision(SwerveState state, VisionIO io)
      Creates the vision subsystem.
      Parameters:
      state - shared swerve pose estimator to receive vision updates
      io - vision IO implementation responsible for acquiring camera results
  • Method Details

    • periodic

      public void periodic()