Class AprilTagVisionIOPhotonVisionSim

java.lang.Object
frc.robot.subsystems.apriltagvision.io.AprilTagVisionIOPhotonVision
frc.robot.subsystems.apriltagvision.io.AprilTagVisionIOPhotonVisionSim
All Implemented Interfaces:
AprilTagVisionIO

public class AprilTagVisionIOPhotonVisionSim extends AprilTagVisionIOPhotonVision
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.

  • 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 instance
      robotToCamera - robot-to-camera transform in meters and radians
      fieldLayout - AprilTag field layout used for tag poses
      maxTagDistanceMeters - maximum distance in meters from camera to a tag; tags beyond this are excluded
      poseSupplier - supplier of the robot pose used for simulation updates (odometry or ground truth, not fused robot state)
  • Method Details