Package frc.lib.util
Class PhotonCameraWrapper
java.lang.Object
frc.lib.util.PhotonCameraWrapper
PhotonCamera-based Pose Estimator.
-
Constructor Summary
ConstructorsConstructorDescriptionPhotonCameraWrapper(String cameraName, Transform3d robotToCam) PhotonCamera-based Pose Estimator. -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.photonvision.EstimatedRobotPose>getEstimatedGlobalPose(Pose2d prevEstimatedRobotPose) Get estimated pose without a prior.doublelatency()booleanGets if photonvision can see a target.
-
Constructor Details
-
PhotonCameraWrapper
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
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
-