Class AprilTagVisionIOPhotonVisionSim
java.lang.Object
frc.robot.subsystems.apriltagvision.io.AprilTagVisionIOPhotonVision
frc.robot.subsystems.apriltagvision.io.AprilTagVisionIOPhotonVisionSim
- All Implemented Interfaces:
AprilTagVisionIO
AprilTagVisionIO implementation to use during simulation.
The pose supplier should provide raw odometry or ground-truth poses. Do not use the fused robot state pose to avoid feedback loops that can make simulated vision look unrealistically perfect.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.robot.subsystems.apriltagvision.io.AprilTagVisionIO
AprilTagVisionIO.AprilTagVisionIOInputs, AprilTagVisionIO.PoseObservation, AprilTagVisionIO.TargetObservation -
Field Summary
Fields inherited from class frc.robot.subsystems.apriltagvision.io.AprilTagVisionIOPhotonVision
camera, fieldLayout, maxTagDistanceMeters, robotToCamera -
Constructor Summary
ConstructorsConstructorDescriptionAprilTagVisionIOPhotonVisionSim(String cameraName, edu.wpi.first.math.geometry.Transform3d robotToCamera, edu.wpi.first.apriltag.AprilTagFieldLayout fieldLayout, double maxTagDistanceMeters, Supplier<edu.wpi.first.math.geometry.Pose2d> poseSupplier) Construct the instance with the usual config plus a live robot pose supplier. -
Method Summary
Modifier and TypeMethodDescriptionvoidRefreshes the inputs structure with the latest state from the vision subsystem.
-
Constructor Details
-
AprilTagVisionIOPhotonVisionSim
public AprilTagVisionIOPhotonVisionSim(String cameraName, edu.wpi.first.math.geometry.Transform3d robotToCamera, edu.wpi.first.apriltag.AprilTagFieldLayout fieldLayout, double maxTagDistanceMeters, Supplier<edu.wpi.first.math.geometry.Pose2d> poseSupplier) Construct the instance with the usual config plus a live robot pose supplier.Use the drive base pose so the simulated camera can render realistic tag observations.
- Parameters:
cameraName- name of the PhotonVision camera instancerobotToCamera- robot-to-camera transform in meters and radiansfieldLayout- AprilTag field layout used for tag posesmaxTagDistanceMeters- maximum distance in meters from camera to a tag; tags beyond this are excludedposeSupplier- supplier of the robot pose used for simulation updates (odometry or ground truth, not fused robot state)
-
-
Method Details
-
updateInputs
Description copied from interface:AprilTagVisionIORefreshes the inputs structure with the latest state from the vision subsystem.- Specified by:
updateInputsin interfaceAprilTagVisionIO- Overrides:
updateInputsin classAprilTagVisionIOPhotonVision- Parameters:
inputs- mutable inputs container to populate for logging
-