Skip to content

Radar sectors not clearing ocasionally #1

Description

@CaptKrasno

Occasionally, radar sectors won't clear causing targets to "smear" over time. Probably there is something going wrong in this section of code:

grid_map::Polygon sector_polygon;
// Build triangle vertices
{
grid_map::Position p0(transform.transform.translation.x, transform.transform.translation.y);
double left_angle = msg->angle_start + yaw;
double right_angle = msg->angle_start + (msg->intensities.size() - 1) * msg->angle_increment + yaw;
double max_range = msg->range_max*1.3;
grid_map::Position p1(
transform.transform.translation.x + max_range * std::cos(left_angle),
transform.transform.translation.y + max_range * std::sin(left_angle));
grid_map::Position p2(
transform.transform.translation.x + max_range * std::cos(right_angle),
transform.transform.translation.y + max_range * std::sin(right_angle));
sector_polygon.addVertex(p0);
sector_polygon.addVertex(p1);
sector_polygon.addVertex(p2);
}
// Iterate over all cells in the polygon and clear them
for (grid_map::PolygonIterator it(*map_ptr_, sector_polygon); !it.isPastEnd(); ++it) {
map_ptr_->at("intensity", *it) = NAN;
}

Either find the bug or find another efficient and reliable way to clear the sectors.

@antonellla keep an eye out for it as you work on the other projects (please screenshot and attach here if you catch it I didn't think to in the moment).

-Kris

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions