We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c41f69b commit 03773a3Copy full SHA for 03773a3
nav2_costmap_2d/src/costmap_2d.cpp
@@ -350,11 +350,15 @@ bool Costmap2D::setConvexPolygonCost(
350
convexFillCells(map_polygon, polygon_cells);
351
352
// set the cost of those cells
353
+ bool cells_written = false;
354
for (unsigned int i = 0; i < polygon_cells.size(); ++i) {
355
unsigned int index = getIndex(polygon_cells[i].x, polygon_cells[i].y);
- costmap_[index] = cost_value;
356
+ if (index < size_x_ * size_y_) {
357
+ costmap_[index] = cost_value;
358
+ cells_written = true;
359
+ }
360
}
- return true;
361
+ return cells_written;
362
363
364
void Costmap2D::polygonOutlineCells(
0 commit comments