Skip to content

Commit

Permalink
[glass] Default to 2024 field image
Browse files Browse the repository at this point in the history
Also relax field scale check a bit so 2024 field image passes.
  • Loading branch information
PeterJohnson committed Jan 14, 2024
1 parent d2ee423 commit e1d8773
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glass/src/lib/native/cpp/other/Field2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static bool InputPose(frc::Pose2d* pose) {
}

FieldInfo::FieldInfo(Storage& storage)
: m_builtin{storage.GetString("builtin")},
: m_builtin{storage.GetString("builtin", "2024 Crescendo")},
m_filename{storage.GetString("image")},
m_width{storage.GetFloat("width", kDefaultWidth.to<float>())},
m_height{storage.GetFloat("height", kDefaultHeight.to<float>())},
Expand Down Expand Up @@ -511,7 +511,7 @@ bool FieldInfo::LoadJson(std::span<const char> is, std::string_view filename) {
// check scaling
int fieldWidth = m_right - m_left;
int fieldHeight = m_bottom - m_top;
if (std::abs((fieldWidth / width) - (fieldHeight / height)) > 0.1) {
if (std::abs((fieldWidth / width) - (fieldHeight / height)) > 0.3) {
fmt::print(stderr,
"GUI: Field X and Y scaling substantially different: "
"xscale={} yscale={}\n",
Expand Down

0 comments on commit e1d8773

Please sign in to comment.