Skip to content

Commit

Permalink
Update inflation_layer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Nisarg236 authored Dec 23, 2024
1 parent 591fa28 commit d21bc2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions costmap_2d/plugins/inflation_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void InflationLayer::updateCosts(costmap_2d::Costmap2D& master_grid, int min_i,

// Process cells by increasing distance; new cells are appended to the corresponding distance bin, so they
// can overtake previously inserted but farther away cells
for (auto& dist_bin: inflation_cells_)
for (auto& dist_bin: inflation_cells_)
{
dist_bin.reserve(200);
for (std::size_t i = 0; i < dist_bin.size(); ++i)
Expand Down Expand Up @@ -301,8 +301,7 @@ inline void InflationLayer::enqueue(unsigned int index, unsigned int mx, unsigne
const int r = cell_inflation_radius_ + 2;

// push the cell data onto the inflation list and mark
const auto dist = distance_matrix_[mx - src_x + r][my - src_y + r];
inflation_cells_[dist].emplace_back(mx, my, src_x, src_y);
inflation_cells_[distance_matrix_[mx - src_x + r][my - src_y + r]].emplace_back(mx, my, src_x, src_y);
}
}

Expand Down

0 comments on commit d21bc2e

Please sign in to comment.