Skip to content

Commit

Permalink
fix(compare_map_segmentation): fix process died for invalid access au…
Browse files Browse the repository at this point in the history
…towarefoundation#4676 (#753)

fix(compare_map_segmentation): fix process died for invalid access (autowarefoundation#4676)

* fix(compare_map_segmentation): fix process died for invalid access



* style(pre-commit): autofix

* fix: missing username in TODO



* fix: change condition



* fix



---------

Signed-off-by: 1222-takeshi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
1222-takeshi and pre-commit-ci[bot] authored Aug 21, 2023
1 parent 30a4eaf commit 40e791e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ class VoxelGridDynamicMapLoader : public VoxelGridMapLoader
int index = static_cast<int>(
std::floor((kv.second.min_b_x - origin_x_) / map_grid_size_x_) +
map_grids_x_ * std::floor((kv.second.min_b_y - origin_y_) / map_grid_size_y_));
if (index >= map_grids_x_ * map_grids_y_) {
// TODO(1222-takeshi): check if index is valid
if (index >= map_grids_x_ * map_grids_y_ || index < 0) {
continue;
}
current_voxel_grid_array_.at(index) = std::make_shared<MapGridVoxelInfo>(kv.second);
Expand Down

0 comments on commit 40e791e

Please sign in to comment.