Package frc.robot.subsystems.vision
Class Vision
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.vision.Vision
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 inConstants.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 Summary
Constructors -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
Vision
Creates the vision subsystem.- Parameters:
state- shared swerve pose estimator to receive vision updatesio- vision IO implementation responsible for acquiring camera results
-
-
Method Details
-
periodic
public void periodic()
-