mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00: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
- Add a field layout CSV file to
src/main/native/resources/org/wpilib/vision/apriltag- See docstring in
convert_apriltag_layouts.pyfor more
- See docstring in
- Run
convert_apriltag_layouts.pyin the same directory as this readme to generate the JSON - That script overwrites all generated JSONs, so undo undesired changes if necessary
- Update the field dimensions at the bottom of the JSON
- Length should be in meters from alliance wall to alliance wall
- Width should be in meters from inside guardrail plastic to plastic
Java updates
- Update
src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java- Add enum value for new field to
AprilTagFields - Update
AprilTagFields.kDefaultFieldif necessary
- Add enum value for new field to
C++ updates
- Update
src/main/native/include/wpi/apriltag/AprilTagFields.hpp- Add enum value for new field to
AprilTagFields - Update
AprilTagFields::kDefaultFieldif necessary
- Add enum value for new field to
- Update
src/main/native/cpp/AprilTagFieldLayout.cpp- Add resource getter prototype like
std::string_view GetResource_2024_crescendo_json() - Add case for new field to switch in
LoadField(AprilTagField field)
- Add resource getter prototype like