Skip to content

Commit

Permalink
feat(compare_map_segmentation): tuning compare map filter for lv4 test (
Browse files Browse the repository at this point in the history
autowarefoundation#1170)

* feat: tuning voxel filter for lv4

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>

* style(pre-commit): autofix

---------

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
YoshiRi and pre-commit-ci[bot] authored Mar 11, 2024
1 parent 8580577 commit 9133ea1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,11 @@ bool VoxelGridMapLoader::is_in_voxel(
if (voxel_index != -1) { // not empty voxel
const double dist_x = map->points.at(voxel_index).x - target_point.x;
const double dist_y = map->points.at(voxel_index).y - target_point.y;
const double dist_z = map->points.at(voxel_index).z - target_point.z;
const double sqr_distance = dist_x * dist_x + dist_y * dist_y + dist_z * dist_z;
if (sqr_distance < distance_threshold * distance_threshold * downsize_ratio_z_axis_) {
const double dist_z = map->points.at(voxel_index).z - target_point.z - 0.1;
// check if the point is inside the distance threshold voxel
if (
std::abs(dist_x) < distance_threshold && std::abs(dist_y) < distance_threshold &&
std::abs(dist_z) < distance_threshold * downsize_ratio_z_axis_) {
return true;
}
}
Expand Down

0 comments on commit 9133ea1

Please sign in to comment.