Files
allwpilib/apriltag
PJ Reiniger f8de482385 [bazel] Update toolchains to 2027-1 (#9016)
This updates to the 2027-1 toolchains. This also is the first version
with the `rules_bzlmodrio_toolchains -> wpilib_toolchains` rename, so
the surface area of the change is a little bit big.

The opencv dep has bzlmod'ified as part of this as well.
2026-06-26 22:44:00 -07:00
..

AprilTag

A C++ wrapper around the University of Michigan's AprilTag detector, alongside a vendored copy of their code with some patches (patches are located in upstream_utils).

Adding new field to AprilTagFields

Adding field JSON

  1. Add a field layout CSV file to src/main/native/resources/org/wpilib/vision/apriltag
    1. See docstring in convert_apriltag_layouts.py for more
  2. Run convert_apriltag_layouts.py in the same directory as this readme to generate the JSON
  3. That script overwrites all generated JSONs, so undo undesired changes if necessary
  4. Update the field dimensions at the bottom of the JSON
    1. Length should be in meters from alliance wall to alliance wall
    2. Width should be in meters from inside guardrail plastic to plastic

Java updates

  1. Update src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java
    1. Add enum value for new field to AprilTagFields
    2. Update AprilTagFields.kDefaultField if necessary

C++ updates

  1. Update src/main/native/include/wpi/apriltag/AprilTagFields.hpp
    1. Add enum value for new field to AprilTagFields
    2. Update AprilTagFields::kDefaultField if necessary
  2. Update src/main/native/cpp/AprilTagFieldLayout.cpp
    1. Add resource getter prototype like std::string_view GetResource_2024_crescendo_json()
    2. Add case for new field to switch in LoadField(AprilTagField field)