File tree 1 file changed +3
-3
lines changed
perception/compare_map_segmentation/src
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -240,9 +240,9 @@ bool VoxelGridMapLoader::is_in_voxel(
240
240
if (voxel_index != -1 ) { // not empty voxel
241
241
const double dist_x = map->points .at (voxel_index).x - target_point.x ;
242
242
const double dist_y = map->points .at (voxel_index).y - target_point.y ;
243
- 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 + dist_z * dist_z;
245
- if (sqr_distance < distance_threshold * distance_threshold * downsize_ratio_z_axis_) {
243
+ const double dist_z = map->points .at (voxel_index).z - target_point.z - 0.1 ;
244
+ // check if the point is inside the distance threshold voxel
245
+ if ( std::abs (dist_x) < distance_threshold && std::abs (dist_y) < distance_threshold && std::abs (dist_z) < distance_threshold * downsize_ratio_z_axis_){
246
246
return true ;
247
247
}
248
248
}
You can’t perform that action at this time.
0 commit comments