From f11c243415f7a605626d1575e407ebe77fb92f05 Mon Sep 17 00:00:00 2001 From: Sid Parikh Date: Tue, 5 Mar 2024 20:09:44 -0500 Subject: [PATCH] update field dims --- soccer/src/soccer/strategy/agent/position/marker.cpp | 4 ++++ soccer/src/soccer/strategy/agent/position/marker.hpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/soccer/src/soccer/strategy/agent/position/marker.cpp b/soccer/src/soccer/strategy/agent/position/marker.cpp index fe76a6c30c3..fd39297d74f 100644 --- a/soccer/src/soccer/strategy/agent/position/marker.cpp +++ b/soccer/src/soccer/strategy/agent/position/marker.cpp @@ -8,6 +8,10 @@ Marker::Marker(FieldDimensions field_dimensions) { std::optional Marker::get_task(RobotIntent intent, const WorldState* world_state, [[maybe_unused]] FieldDimensions field_dimensions) { + + this->y_bound = field_dimensions.length() / 2; + this->marker_follow_cutoff = field_dimensions.width() / 2; + rj_geometry::Point targetPoint = world_state->get_robot(false, target_).pose.position(); rj_geometry::Point ballPoint = world_state->ball.position; rj_geometry::Point targetToBall = (ballPoint - targetPoint).normalized(0.55f); diff --git a/soccer/src/soccer/strategy/agent/position/marker.hpp b/soccer/src/soccer/strategy/agent/position/marker.hpp index 8f0eb4aa542..cd6cf9579d1 100644 --- a/soccer/src/soccer/strategy/agent/position/marker.hpp +++ b/soccer/src/soccer/strategy/agent/position/marker.hpp @@ -22,8 +22,8 @@ class Marker : public RoleInterface { //Calculated from field dimensions - Prevent the marker from //marking any enemies that are out of range; e. g. on the other //side of the field or the sidelines. - float y_bound {0.0f}; - float marker_follow_cutoff {0.0f}; + float y_bound {FieldDimensions::kDefaultDimensions.length() / 2}; + float marker_follow_cutoff {FieldDimensions::kDefaultDimensions.width() / 2}; public: Marker(FieldDimensions field_dimensions);