From 2d8b35cc0210c883a95f674ae479e15cd9eabdfa Mon Sep 17 00:00:00 2001 From: vividf Date: Thu, 15 Aug 2024 12:29:07 +0900 Subject: [PATCH 1/5] feat: rework pickup based voxel grid downsample filter parameter Signed-off-by: vividf --- .../CMakeLists.txt | 2 +- ...xel_grid_downsample_filter_node.param.yaml | 5 +++ .../docs/downsample-filter.md | 6 +-- ...sed_voxel_grid_downsample_filter_node.hpp} | 6 +-- ...xel_grid_downsample_filter_node.launch.xml | 16 +++++++ ...el_grid_downsample_filter_node.schema.json | 43 +++++++++++++++++++ ...sed_voxel_grid_downsample_filter_node.cpp} | 8 ++-- 7 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 sensing/autoware_pointcloud_preprocessor/config/pickup_based_voxel_grid_downsample_filter_node.param.yaml rename sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/{pickup_based_voxel_grid_downsample_filter.hpp => pickup_based_voxel_grid_downsample_filter_node.hpp} (92%) create mode 100644 sensing/autoware_pointcloud_preprocessor/launch/pickup_based_voxel_grid_downsample_filter_node.launch.xml create mode 100644 sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json rename sensing/autoware_pointcloud_preprocessor/src/downsample_filter/{pickup_based_voxel_grid_downsample_filter.cpp => pickup_based_voxel_grid_downsample_filter_node.cpp} (96%) diff --git a/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt b/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt index 744bac480e058..b6d6bbebc6564 100644 --- a/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt +++ b/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt @@ -69,7 +69,7 @@ ament_auto_add_library(pointcloud_preprocessor_filter SHARED src/downsample_filter/voxel_grid_downsample_filter_nodelet.cpp src/downsample_filter/random_downsample_filter_nodelet.cpp src/downsample_filter/approximate_downsample_filter_nodelet.cpp - src/downsample_filter/pickup_based_voxel_grid_downsample_filter.cpp + src/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.cpp src/outlier_filter/ring_outlier_filter_nodelet.cpp src/outlier_filter/voxel_grid_outlier_filter_nodelet.cpp src/outlier_filter/radius_search_2d_outlier_filter_nodelet.cpp diff --git a/sensing/autoware_pointcloud_preprocessor/config/pickup_based_voxel_grid_downsample_filter_node.param.yaml b/sensing/autoware_pointcloud_preprocessor/config/pickup_based_voxel_grid_downsample_filter_node.param.yaml new file mode 100644 index 0000000000000..3a996929e91ef --- /dev/null +++ b/sensing/autoware_pointcloud_preprocessor/config/pickup_based_voxel_grid_downsample_filter_node.param.yaml @@ -0,0 +1,5 @@ +/**: + ros__parameters: + voxel_size_x: 1.0 + voxel_size_y: 1.0 + voxel_size_z: 1.0 diff --git a/sensing/autoware_pointcloud_preprocessor/docs/downsample-filter.md b/sensing/autoware_pointcloud_preprocessor/docs/downsample-filter.md index ac721171cb014..f688ed3d9469d 100644 --- a/sensing/autoware_pointcloud_preprocessor/docs/downsample-filter.md +++ b/sensing/autoware_pointcloud_preprocessor/docs/downsample-filter.md @@ -58,11 +58,7 @@ These implementations inherit `autoware::pointcloud_preprocessor::Filter` class, ### Pickup Based Voxel Grid Downsample Filter -| Name | Type | Default Value | Description | -| -------------- | ------ | ------------- | ---------------- | -| `voxel_size_x` | double | 1.0 | voxel size x [m] | -| `voxel_size_y` | double | 1.0 | voxel size y [m] | -| `voxel_size_z` | double | 1.0 | voxel size z [m] | +{{ json_to_markdown("sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter.schema.json") }} ## Assumptions / Known limits diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp similarity index 92% rename from sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter.hpp rename to sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp index 9a1f2780be11b..eb6e093c9d967 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_HPP_ // NOLINT -#define AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_HPP_ // NOLINT +#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_NODE_HPP_ // NOLINT +#define AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_NODE_HPP_ // NOLINT #include "autoware/pointcloud_preprocessor/filter.hpp" @@ -61,5 +61,5 @@ class PickupBasedVoxelGridDownsampleFilterComponent } // namespace autoware::pointcloud_preprocessor // clang-format off -#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_HPP_ // NOLINT +#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__DOWNSAMPLE_FILTER__PICKUP_BASED_VOXEL_GRID_DOWNSAMPLE_FILTER_NODE_HPP_ // NOLINT // clang-format on diff --git a/sensing/autoware_pointcloud_preprocessor/launch/pickup_based_voxel_grid_downsample_filter_node.launch.xml b/sensing/autoware_pointcloud_preprocessor/launch/pickup_based_voxel_grid_downsample_filter_node.launch.xml new file mode 100644 index 0000000000000..7c035cbcf1b52 --- /dev/null +++ b/sensing/autoware_pointcloud_preprocessor/launch/pickup_based_voxel_grid_downsample_filter_node.launch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json new file mode 100644 index 0000000000000..41a7ad0d4d8d7 --- /dev/null +++ b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for Pickup Based Voxel Grid Downsample Filter Node", + "type": "object", + "definitions": { + "pickup_based_voxel_grid_downsample_fitler": { + "type": "object", + "properties": { + "voxel_size_x": { + "type": "number", + "description": "voxel size along x-axis [m]", + "default": "1.0" + }, + "voxel_size_y": { + "type": "number", + "description": "voxel size along y-axis [m]", + "default": "1.0" + }, + "voxel_size_z": { + "type": "number", + "description": "voxel size along z-axis [m]", + "default": "1.0" + } + }, + "required": ["voxel_size_x", "voxel_size_y", "voxel_size_z"], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/pickup_based_voxel_grid_downsample_fitler" + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false +} diff --git a/sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter.cpp b/sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.cpp similarity index 96% rename from sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter.cpp rename to sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.cpp index 834f9b8d8fbc0..e3c6af7433dda 100644 --- a/sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter.cpp +++ b/sensing/autoware_pointcloud_preprocessor/src/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter.hpp" +#include "autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp" #include "robin_hood.h" @@ -66,9 +66,9 @@ PickupBasedVoxelGridDownsampleFilterComponent::PickupBasedVoxelGridDownsampleFil } // Initialization of voxel sizes from parameters - voxel_size_x_ = static_cast(declare_parameter("voxel_size_x", 1.0)); - voxel_size_y_ = static_cast(declare_parameter("voxel_size_y", 1.0)); - voxel_size_z_ = static_cast(declare_parameter("voxel_size_z", 1.0)); + voxel_size_x_ = declare_parameter("voxel_size_x"); + voxel_size_y_ = declare_parameter("voxel_size_y"); + voxel_size_z_ = declare_parameter("voxel_size_z"); using std::placeholders::_1; set_param_res_ = this->add_on_set_parameters_callback( From 2dbe66097e958693ffa25758248d178a86105fe3 Mon Sep 17 00:00:00 2001 From: vividf Date: Thu, 15 Aug 2024 12:31:12 +0900 Subject: [PATCH 2/5] chore: update date Signed-off-by: vividf --- .../pickup_based_voxel_grid_downsample_filter_node.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp index eb6e093c9d967..bdaf8bca46f74 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/downsample_filter/pickup_based_voxel_grid_downsample_filter_node.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 TIER IV, Inc. +// Copyright 2024 TIER IV, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 041496da6a96ee804b437ca15370b198980a8f42 Mon Sep 17 00:00:00 2001 From: vividf Date: Thu, 15 Aug 2024 12:37:22 +0900 Subject: [PATCH 3/5] chore: fix spell error Signed-off-by: vividf --- ...pickup_based_voxel_grid_downsample_filter_node.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json index 41a7ad0d4d8d7..895de0085b1f7 100644 --- a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json +++ b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json @@ -3,7 +3,7 @@ "title": "Parameters for Pickup Based Voxel Grid Downsample Filter Node", "type": "object", "definitions": { - "pickup_based_voxel_grid_downsample_fitler": { + "pickup_based_voxel_grid_downsample_filter": { "type": "object", "properties": { "voxel_size_x": { @@ -31,7 +31,7 @@ "type": "object", "properties": { "ros__parameters": { - "$ref": "#/definitions/pickup_based_voxel_grid_downsample_fitler" + "$ref": "#/definitions/pickup_based_voxel_grid_downsample_filter" } }, "required": ["ros__parameters"], From 40feff625de91cc41ea5406aacdce703ce6223fe Mon Sep 17 00:00:00 2001 From: vividf Date: Tue, 20 Aug 2024 17:25:45 +0900 Subject: [PATCH 4/5] chore: add boundary Signed-off-by: vividf --- ...p_based_voxel_grid_downsample_filter_node.schema.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json index 895de0085b1f7..5142f81d05c98 100644 --- a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json +++ b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json @@ -9,17 +9,20 @@ "voxel_size_x": { "type": "number", "description": "voxel size along x-axis [m]", - "default": "1.0" + "default": "1.0", + "minimum": 0 }, "voxel_size_y": { "type": "number", "description": "voxel size along y-axis [m]", - "default": "1.0" + "default": "1.0", + "minimum": 0 }, "voxel_size_z": { "type": "number", "description": "voxel size along z-axis [m]", - "default": "1.0" + "default": "1.0", + "minimum": 0 } }, "required": ["voxel_size_x", "voxel_size_y", "voxel_size_z"], From 6c167283a209871e248b2f0227da2a35baf31a65 Mon Sep 17 00:00:00 2001 From: vividf Date: Thu, 5 Sep 2024 23:25:54 +0900 Subject: [PATCH 5/5] chore: fix grammatical error Signed-off-by: vividf --- ...ckup_based_voxel_grid_downsample_filter_node.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json index 5142f81d05c98..2e3b7f41787c8 100644 --- a/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json +++ b/sensing/autoware_pointcloud_preprocessor/schema/pickup_based_voxel_grid_downsample_filter_node.schema.json @@ -8,19 +8,19 @@ "properties": { "voxel_size_x": { "type": "number", - "description": "voxel size along x-axis [m]", + "description": "voxel size along the x-axis [m]", "default": "1.0", "minimum": 0 }, "voxel_size_y": { "type": "number", - "description": "voxel size along y-axis [m]", + "description": "voxel size along the y-axis [m]", "default": "1.0", "minimum": 0 }, "voxel_size_z": { "type": "number", - "description": "voxel size along z-axis [m]", + "description": "voxel size along the z-axis [m]", "default": "1.0", "minimum": 0 }