Skip to content

Commit

Permalink
Preventing solo offense from getting ball out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksherling committed Apr 28, 2024
1 parent 6ec0a0b commit 99c0e1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions soccer/src/soccer/strategy/agent/position/solo_offense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ std::optional<RobotIntent> SoloOffense::derived_get_task(RobotIntent intent) {
// Get next state, and if different, reset clock
State new_state = next_state();
if (new_state != current_state_) {
SPDLOG_INFO("New State: {}", std::to_string(static_cast<int>(new_state)));
//SPDLOG_INFO("New State: {}", std::to_string(static_cast<int>(new_state)));
}
current_state_ = new_state;

Expand Down Expand Up @@ -41,7 +41,7 @@ SoloOffense::State SoloOffense::next_state() {

// SPDLOG_INFO("Closest dist: {}, i-{}", closest_dist, marking_id_);

if (closest_dist < (0.5)) {
if (closest_dist < (0.5) || field_dimensions_.their_goal_area().contains_point(current_point) || field_dimensions_.their_defense_area().contains_point(current_point) || !field_dimensions_.field_coordinates().contains_point(current_point)) {
return MARKER;
}
switch (current_state_) {
Expand Down

0 comments on commit 99c0e1a

Please sign in to comment.