Skip to content

Commit

Permalink
update field dims
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-parikh committed Mar 6, 2024
1 parent 5a22c04 commit f11c243
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions soccer/src/soccer/strategy/agent/position/marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Marker::Marker(FieldDimensions field_dimensions) {

std::optional<RobotIntent> 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);
Expand Down
4 changes: 2 additions & 2 deletions soccer/src/soccer/strategy/agent/position/marker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f11c243

Please sign in to comment.