ignore point too close to the robot

This commit is contained in:
acki
2025-05-27 15:11:16 -04:00
parent 4fd8a936ba
commit 07ec0f131e

View File

@@ -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;