Package frc.lib.util

Class PhotonCameraWrapper

java.lang.Object
frc.lib.util.PhotonCameraWrapper

public class PhotonCameraWrapper extends Object
PhotonCamera-based Pose Estimator.
  • Constructor Details

    • PhotonCameraWrapper

      public PhotonCameraWrapper(String cameraName, Transform3d robotToCam)
      PhotonCamera-based Pose Estimator.
      Parameters:
      cameraName - camera name (not to be confused with mDNS name).
      robotToCam - transform from robot body coordinates to camera coordinates.
  • Method Details

    • seesTarget

      public boolean seesTarget()
      Gets if photonvision can see a target.
    • getInitialPose

      public Optional<Pose2d> getInitialPose()
      Get estimated pose without a prior.
      Returns:
      an estimated Pose2d based solely on apriltags
    • latency

      public double latency()
    • getEstimatedGlobalPose

      public Optional<org.photonvision.EstimatedRobotPose> getEstimatedGlobalPose(Pose2d prevEstimatedRobotPose)
      Parameters:
      prevEstimatedRobotPose - The current best guess at robot pose
      Returns:
      an EstimatedRobotPose with an estimated pose, the timestamp, and targets used to create the estimate