mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Fix non-checked optional in mulit-tag (#808)
* Fix non-checked optional in mulit-tag * Fix fallback return * Run format
This commit is contained in:
@@ -331,12 +331,19 @@ public class PhotonPoseEstimator {
|
||||
|
||||
if (result.getTargets().size() < 2) {
|
||||
// Run fallback strategy instead
|
||||
update(result, this.multiTagFallbackStrategy);
|
||||
return update(result, this.multiTagFallbackStrategy);
|
||||
}
|
||||
|
||||
for (var target : result.getTargets()) {
|
||||
visCorners.addAll(target.getDetectedCorners());
|
||||
Pose3d tagPose = fieldTags.getTagPose(target.getFiducialId()).get();
|
||||
|
||||
var tagPoseOpt = fieldTags.getTagPose(target.getFiducialId());
|
||||
if (tagPoseOpt.isEmpty()) {
|
||||
reportFiducialPoseError(target.getFiducialId());
|
||||
continue;
|
||||
}
|
||||
|
||||
var tagPose = tagPoseOpt.get();
|
||||
|
||||
// actual layout poses of visible tags -- not exposed, so have to recreate
|
||||
knownVisTags.add(new AprilTag(target.getFiducialId(), tagPose));
|
||||
|
||||
Reference in New Issue
Block a user