Skip to content

Commit

Permalink
Fix atfl always being null
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Aug 24, 2023
1 parent 6a92beb commit 34330fa
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,12 @@ public void load() {
atfl =
JacksonUtils.deserialize(apriltagFieldLayoutFile.toPath(), AprilTagFieldLayout.class);
if (atfl == null) {
logger.error("Could not deserialize apriltag field layout!");
logger.error("Could not deserialize apriltag field layout! (still null)");
}
} catch (IOException e) {
logger.error("Could not deserialize apriltag field layout!");
logger.error("Could not deserialize apriltag field layout!", e);
atfl = null; // not required, nice to be explicit
}
logger.info("Apriltag layout file not saved!");
atfl = null; // not required, nice to be explicit
}
if (atfl == null) {
logger.info("Loading default apriltags for 2023 field...");
Expand All @@ -206,7 +204,7 @@ public void load() {
atfl = null;
}
if (atfl == null) {
// what do we even do here lmao -- wpilib should always work
// what do we even do here lmao -- wpilib built-in should always work
logger.error("Field layout is *still* null??????");
atfl = new AprilTagFieldLayout(List.of(), 1, 1);
}
Expand Down

0 comments on commit 34330fa

Please sign in to comment.