diff --git a/src/modelec_strat/src/enemy_manager.cpp b/src/modelec_strat/src/enemy_manager.cpp index c7b73ec..9bb9274 100644 --- a/src/modelec_strat/src/enemy_manager.cpp +++ b/src/modelec_strat/src/enemy_manager.cpp @@ -103,6 +103,12 @@ namespace Modelec continue; } + if (range < robot_radius_) + { + angle += msg->angle_increment; + continue; + } + // Convert to local robot frame double x_local = range * std::cos(angle) * 1000.0; // meters -> mm double y_local = range * std::sin(angle) * 1000.0; // meters -> mm @@ -118,12 +124,6 @@ namespace Modelec continue; } - if (std::hypot(x_global - robot_x, y_global - robot_y) < robot_radius_) - { - angle += msg->angle_increment; - continue; // Ignore points too close to the robot - } - if (range < min_distance) { min_distance = range;