diff --git a/nav2_costmap_2d/test/integration/inflation_tests.cpp b/nav2_costmap_2d/test/integration/inflation_tests.cpp index 2e3aa19c53c6e679c274aea065fdd19d1ae54cf4..82c7b9d3c4114b409aff940205bae19295298efa 100644 --- a/nav2_costmap_2d/test/integration/inflation_tests.cpp +++ b/nav2_costmap_2d/test/integration/inflation_tests.cpp @@ -144,6 +144,12 @@ void TestNode::validatePointInflation( continue; } + if (dist == bin->first) { + // Adding to our current bin could cause a reallocation + // Which appears to cause the iterator to get messed up + dist += 0.001; + } + if (cell.x_ > 0) { CellData data(costmap->getIndex(cell.x_ - 1, cell.y_), cell.x_ - 1, cell.y_, cell.src_x_, cell.src_y_);