Update field constants in Spline UI
Updated scaled image with correct field dimensions.
Signed-off-by: Nathan Leong <nathanrleong@gmail.com>
Change-Id: I65c28b37039ba2e49bdc76df15aa4190aefe82bf
diff --git a/frc971/control_loops/python/BUILD b/frc971/control_loops/python/BUILD
index 699eb5a..25bddcd 100644
--- a/frc971/control_loops/python/BUILD
+++ b/frc971/control_loops/python/BUILD
@@ -202,7 +202,7 @@
data = glob([
"field_images/*.png",
"field_images/*.svg",
- ]) + ["//third_party/y2023/field:pictures"],
+ ]) + ["//third_party/y2023/field:pictures"] + ["//third_party/y2024/field:pictures"],
legacy_create_init = False,
target_compatible_with = ["@platforms//cpu:x86_64"],
visibility = ["//visibility:public"],
diff --git a/frc971/control_loops/python/constants.py b/frc971/control_loops/python/constants.py
index 7bc45db..e4ff6b7 100644
--- a/frc971/control_loops/python/constants.py
+++ b/frc971/control_loops/python/constants.py
@@ -37,6 +37,8 @@
Robot2021 = Robot2020
Robot2022 = RobotType(width=0.8763, length=0.96647)
Robot2023 = RobotType(width=0.6061, length=0.77581)
+#TODO (Nathan): Update 2024 robot dimensions when CAD is done
+Robot2024 = RobotType(width=0.9017, length=0.9525) # 35.5 in x 37.5 in
FIELDS = {
"2019 Field":
@@ -127,9 +129,17 @@
length=8.10895,
robot=Robot2023,
field_id="//third_party/y2023/field/2023.png"),
+ "2024 Field":
+ FieldType("2024 Field",
+ tags=[],
+ year=2024,
+ width=16.54175,
+ length=8.21055,
+ robot=Robot2024,
+ field_id="//third_party/y2024/field/2024.png"),
}
-FIELD = FIELDS["2023 Field"]
+FIELD = FIELDS["2024 Field"]
def get_json_folder(field):
@@ -139,6 +149,7 @@
return "y2022/actors/splines"
elif field.year == 2023:
return "y2023/autonomous/splines"
+ #TODO: Update 2024 spline jsons
else:
return "frc971/control_loops/python/spline_jsons"