diff --git a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java index 28eeb58de9..6143920eab 100644 --- a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java +++ b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java @@ -5,12 +5,13 @@ package edu.wpi.first.apriltag; public enum AprilTagFields { - k2022RapidReact("2022-rapidreact.json"); + k2022RapidReact("2022-rapidreact.json"), + k2023ChargedUp("2023-chargedup.json"); public static final String kBaseResourceDir = "/edu/wpi/first/apriltag/"; /** Alias to the current game. */ - public static final AprilTagFields kDefaultField = k2022RapidReact; + public static final AprilTagFields kDefaultField = k2023ChargedUp; public final String m_resourceFile; diff --git a/apriltag/src/main/native/cpp/AprilTagFields.cpp b/apriltag/src/main/native/cpp/AprilTagFields.cpp index 3d7b1ed63e..2f929378ba 100644 --- a/apriltag/src/main/native/cpp/AprilTagFields.cpp +++ b/apriltag/src/main/native/cpp/AprilTagFields.cpp @@ -10,6 +10,7 @@ namespace frc { // C++ generated from resource files std::string_view GetResource_2022_rapidreact_json(); +std::string_view GetResource_2023_chargedup_json(); AprilTagFieldLayout LoadAprilTagLayoutField(AprilTagField field) { std::string_view fieldString; @@ -17,6 +18,9 @@ AprilTagFieldLayout LoadAprilTagLayoutField(AprilTagField field) { case AprilTagField::k2022RapidReact: fieldString = GetResource_2022_rapidreact_json(); break; + case AprilTagField::k2023ChargedUp: + fieldString = GetResource_2023_chargedup_json(); + break; case AprilTagField::kNumFields: throw std::invalid_argument("Invalid Field"); } diff --git a/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h b/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h index 2810a1aac0..4bab29919c 100644 --- a/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h +++ b/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h @@ -14,6 +14,7 @@ namespace frc { enum class AprilTagField { k2022RapidReact, + k2023ChargedUp, // This is a placeholder for denoting the last supported field. This should // always be the last entry in the enum and should not be used by users diff --git a/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2023-chargedup.json b/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2023-chargedup.json new file mode 100644 index 0000000000..5ce72884e9 --- /dev/null +++ b/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2023-chargedup.json @@ -0,0 +1,152 @@ +{ + "tags": [ + { + "ID": 1, + "pose": { + "translation": { + "x": 15.513558, + "y": 1.071626, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 0.0, + "X": 0.0, + "Y": 0.0, + "Z": 1.0 + } + } + } + }, + { + "ID": 2, + "pose": { + "translation": { + "x": 15.513558, + "y": 2.748026, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 0.0, + "X": 0.0, + "Y": 0.0, + "Z": 1.0 + } + } + } + }, + { + "ID": 3, + "pose": { + "translation": { + "x": 15.513558, + "y": 4.424426, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 0.0, + "X": 0.0, + "Y": 0.0, + "Z": 1.0 + } + } + } + }, + { + "ID": 4, + "pose": { + "translation": { + "x": 16.178784, + "y": 6.749796, + "z": 0.695452 + }, + "rotation": { + "quaternion": { + "W": 0.0, + "X": 0.0, + "Y": 0.0, + "Z": 1.0 + } + } + } + }, + { + "ID": 5, + "pose": { + "translation": { + "x": 0.36195, + "y": 6.749796, + "z": 0.695452 + }, + "rotation": { + "quaternion": { + "W": 1.0, + "X": 0.0, + "Y": 0.0, + "Z": 0.0 + } + } + } + }, + { + "ID": 6, + "pose": { + "translation": { + "x": 1.02743, + "y": 4.424426, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 1.0, + "X": 0.0, + "Y": 0.0, + "Z": 0.0 + } + } + } + }, + { + "ID": 7, + "pose": { + "translation": { + "x": 1.02743, + "y": 2.748026, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 1.0, + "X": 0.0, + "Y": 0.0, + "Z": 0.0 + } + } + } + }, + { + "ID": 8, + "pose": { + "translation": { + "x": 1.02743, + "y": 1.071626, + "z": 0.462788 + }, + "rotation": { + "quaternion": { + "W": 1.0, + "X": 0.0, + "Y": 0.0, + "Z": 0.0 + } + } + } + } + ], + "field": { + "length": 16.54175, + "width": 8.0137 + } +}