Skip to content

Commit

Permalink
add test for empty case
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Turner <[email protected]>
  • Loading branch information
spacey-sooty committed Feb 19, 2025
1 parent 04ea1db commit 18d0b3a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ void testMultiTagOnRioFallback() {
() -> assertEquals(2, pose.getZ(), 1e-9));
}

@Test
public void testConstrainedPnpOneTag() {
var distortion = VecBuilder.fill(0, 0, 0, 0, 0, 0, 0, 0);
var cameraMat =
Expand Down Expand Up @@ -898,6 +899,18 @@ public void testConstrainedPnpOneTag() {
System.out.println(pose);
}

@Test
void testConstrainedPnpEmptyCase() {
PhotonPoseEstimator estimator =
new PhotonPoseEstimator(
AprilTagFieldLayout.loadField(AprilTagFields.k2024Crescendo),
PoseStrategy.CONSTRAINED_SOLVEPNP,
Transform3d.kZero);
PhotonPipelineResult result = new PhotonPipelineResult();
var estimate = estimator.update(result);
assertEquals(estimate, Optional.empty());
}

private static class PhotonCameraInjector extends PhotonCamera {
public PhotonCameraInjector() {
super("Test");
Expand Down

0 comments on commit 18d0b3a

Please sign in to comment.