Skip to content

Commit

Permalink
feat: tuning voxel filter for lv4
Browse files Browse the repository at this point in the history
Signed-off-by: yoshiri <[email protected]>
  • Loading branch information
YoshiRi committed Mar 4, 2024
1 parent c5a5436 commit 68865a3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ 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 68865a3

Please sign in to comment.