mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-03-18 21:50:36 +01:00
ignore point too close to the robot
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user