Photon vision field resource

Where do I find the AprilTagFields.k2023ChargedUp.m_resourceFile that is used in this photon vision example code for getting the field position?

AprilTagFieldLayout aprilTagFieldLayout = AprilTagFieldLayout.loadFromResource(AprilTagFields.k2023ChargedUp.m_resourceFile);

It’s in the latest WPILib. Make sure you’re updated to the latest in your robot code (install it on your laptop as well).

It still gives me the error:

unhandled exception type IOException

even after I updated it.

It throws a checked exception so you need a try/catch.

    AprilTagFieldLayout layout;
    try {
      layout = AprilTagFields.k2023ChargedUp.loadAprilTagLayoutField();
    } catch(IOException e) {
        // TODO decide what you want to do if the layout fails to load
    }

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.