diff --git a/photon-core/src/main/java/org/photonvision/vision/pipeline/AprilTagPipeline.java b/photon-core/src/main/java/org/photonvision/vision/pipeline/AprilTagPipeline.java index 6f2a110824..be2ff6e9dc 100644 --- a/photon-core/src/main/java/org/photonvision/vision/pipeline/AprilTagPipeline.java +++ b/photon-core/src/main/java/org/photonvision/vision/pipeline/AprilTagPipeline.java @@ -168,8 +168,8 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting AprilTagPoseEstimate tagPoseEstimate = null; // Do single-tag estimation when "always enabled" or if a tag was not used for multitag if (settings.doSingleTargetAlways - || (multiTagResultOpt.isPresent() - && !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId()))) { + || multiTagResultOpt.isEmpty() + || !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId())) { var poseResult = singleTagPoseEstimatorPipe.run(detection); sumPipeNanosElapsed += poseResult.nanosElapsed; tagPoseEstimate = poseResult.output; diff --git a/photon-core/src/main/java/org/photonvision/vision/pipeline/ArucoPipeline.java b/photon-core/src/main/java/org/photonvision/vision/pipeline/ArucoPipeline.java index f3af2844cd..b6242fc5af 100644 --- a/photon-core/src/main/java/org/photonvision/vision/pipeline/ArucoPipeline.java +++ b/photon-core/src/main/java/org/photonvision/vision/pipeline/ArucoPipeline.java @@ -190,8 +190,8 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings) // Do single-tag estimation when "always enabled" or if a tag was not used for multitag if (settings.doSingleTargetAlways - || (multiTagResultOpt.isPresent() - && !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId()))) { + || multiTagResultOpt.isEmpty() + || !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId())) { var poseResult = singleTagPoseEstimatorPipe.run(detection); sumPipeNanosElapsed += poseResult.nanosElapsed; tagPoseEstimate = poseResult.output;