Skip to content

Commit c719cbc

Browse files
committed
changed inclusion model from sphere to cube
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
1 parent ed9de41 commit c719cbc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

perception/compare_map_segmentation/src/voxel_grid_map_loader.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,10 @@ bool VoxelGridMapLoader::is_in_voxel(
241241
const double dist_x = map->points.at(voxel_index).x - target_point.x;
242242
const double dist_y = map->points.at(voxel_index).y - target_point.y;
243243
const double dist_z = map->points.at(voxel_index).z - target_point.z;
244-
const double sqr_distance = dist_x * dist_x + dist_y * dist_y +
245-
dist_z * dist_z * downsize_ratio_z_axis_ * downsize_ratio_z_axis_;
246-
if (sqr_distance < distance_threshold * distance_threshold) {
244+
// check if the point is inside the distance threshold voxel
245+
if (
246+
std::abs(dist_x) < distance_threshold && std::abs(dist_y) < distance_threshold &&
247+
std::abs(dist_z) < distance_threshold * downsize_ratio_z_axis_) {
247248
return true;
248249
}
249250
}

0 commit comments

Comments
 (0)