Skip to content

Commit

Permalink
[fieldImages] Add 2024 field image (#6166)
Browse files Browse the repository at this point in the history
  • Loading branch information
sciencewhiz authored Jan 6, 2024
1 parent a2e4d0b commit 8659372
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fieldImages/src/main/java/edu/wpi/fields/Fields.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ public enum Fields {
k2021GalacticSearchB("2021-galacticsearchb.json"),
k2021Slalom("2021-slalompath.json"),
k2022RapidReact("2022-rapidreact.json"),
k2023ChargedUp("2023-chargedup.json");
k2023ChargedUp("2023-chargedup.json"),
k2024Crescendo("2024-crescendo.json");

public static final String kBaseResourceDir = "/edu/wpi/first/fields/";

/** Alias to the current game. */
public static final Fields kDefaultField = k2023ChargedUp;
public static final Fields kDefaultField = k2024Crescendo;

public final String m_resourceFile;

Expand Down
3 changes: 3 additions & 0 deletions fieldImages/src/main/native/cpp/fields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
#include "fields/2021-slalom.h"
#include "fields/2022-rapidreact.h"
#include "fields/2023-chargedup.h"
#include "fields/2024-crescendo.h"

using namespace fields;

static const Field kFields[] = {
{"2024 Crescendo", GetResource_2024_crescendo_json,
GetResource_2024_field_png},
{"2023 Charged Up", GetResource_2023_chargedup_json,
GetResource_2023_field_png},
{"2022 Rapid React", GetResource_2022_rapidreact_json,
Expand Down
12 changes: 12 additions & 0 deletions fieldImages/src/main/native/include/fields/2024-crescendo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

#pragma once

#include <string_view>

namespace fields {
std::string_view GetResource_2024_crescendo_json();
std::string_view GetResource_2024_field_png();
} // namespace fields
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"game": "Crescendo",
"field-image": "2024-field.png",
"field-corners": {
"top-left": [
46,
36
],
"bottom-right": [
1088,
544
]
},
"field-size": [
54.27083,
26.2916
],
"field-unit": "foot"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8659372

Please sign in to comment.