diff --git a/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt b/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt index 5d7aba4d0567b..2474b483cb2fe 100644 --- a/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt +++ b/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt @@ -74,8 +74,8 @@ ament_auto_add_library(pointcloud_preprocessor_filter SHARED src/outlier_filter/voxel_grid_outlier_filter_node.cpp src/outlier_filter/radius_search_2d_outlier_filter_nodelet.cpp src/outlier_filter/dual_return_outlier_filter_nodelet.cpp - src/passthrough_filter/passthrough_filter_nodelet.cpp - src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp + src/passthrough_filter/passthrough_filter_node.cpp + src/passthrough_filter/passthrough_filter_uint16_node.cpp src/passthrough_filter/passthrough_uint16.cpp src/pointcloud_accumulator/pointcloud_accumulator_nodelet.cpp src/vector_map_filter/lanelet2_map_filter_node.cpp diff --git a/sensing/autoware_pointcloud_preprocessor/config/passthrough_filter_uint16_node.param.yaml b/sensing/autoware_pointcloud_preprocessor/config/passthrough_filter_uint16_node.param.yaml new file mode 100644 index 0000000000000..ff1d31f0db33d --- /dev/null +++ b/sensing/autoware_pointcloud_preprocessor/config/passthrough_filter_uint16_node.param.yaml @@ -0,0 +1,7 @@ +/**: + ros__parameters: + filter_limit_min: 0 + filter_limit_max: 127 + filter_field_name: "channel" + keep_organized: false + filter_limit_negative: false diff --git a/sensing/autoware_pointcloud_preprocessor/docs/passthrough-filter.md b/sensing/autoware_pointcloud_preprocessor/docs/passthrough-filter.md index 4d28f08da28cc..58da60c8fe90e 100644 --- a/sensing/autoware_pointcloud_preprocessor/docs/passthrough-filter.md +++ b/sensing/autoware_pointcloud_preprocessor/docs/passthrough-filter.md @@ -25,13 +25,8 @@ The `passthrough_filter` is a node that removes points on the outside of a range ### Core Parameters -| Name | Type | Default Value | Description | -| ----------------------- | ------ | ------------- | ------------------------------------------------------ | -| `filter_limit_min` | int | 0 | minimum allowed field value | -| `filter_limit_max` | int | 127 | maximum allowed field value | -| `filter_field_name` | string | "ring" | filtering field name | -| `keep_organized` | bool | false | flag to keep indices structure | -| `filter_limit_negative` | bool | false | flag to return whether the data is inside limit or not | +{{ json_to_markdown("sensing/autoware_pointcloud_preprocessor/schema/passthrough_filter_uint16_node.schema.json +") }} ## Assumptions / Known limits diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_nodelet.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_node.hpp similarity index 96% rename from sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_nodelet.hpp rename to sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_node.hpp index bbb2c0b113658..4e9e6f9ab727e 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_nodelet.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_node.hpp @@ -1,4 +1,4 @@ -// Copyright 2020 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. @@ -48,8 +48,8 @@ * */ -#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODELET_HPP_ -#define AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODELET_HPP_ +#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODE_HPP_ +#define AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODE_HPP_ #include "autoware/pointcloud_preprocessor/filter.hpp" @@ -77,4 +77,4 @@ class PassThroughFilterComponent : public autoware::pointcloud_preprocessor::Fil }; } // namespace autoware::pointcloud_preprocessor -#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODELET_HPP_ +#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_NODE_HPP_ diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_nodelet.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_node.hpp similarity index 90% rename from sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_nodelet.hpp rename to sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_node.hpp index 0ffb50dc65092..53ef8eb0cfa7a 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_nodelet.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_node.hpp @@ -1,4 +1,4 @@ -// Copyright 2020 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. @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODELET_HPP_ // NOLINT -#define AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODELET_HPP_ // NOLINT +#ifndef AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODE_HPP_ // NOLINT +#define AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODE_HPP_ // NOLINT #include "autoware/pointcloud_preprocessor/filter.hpp" #include "autoware/pointcloud_preprocessor/passthrough_filter/passthrough_uint16.hpp" @@ -46,5 +46,5 @@ class PassThroughFilterUInt16Component : public autoware::pointcloud_preprocesso } // namespace autoware::pointcloud_preprocessor // clang-format off -#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODELET_HPP_ // NOLINT +#endif // AUTOWARE__POINTCLOUD_PREPROCESSOR__PASSTHROUGH_FILTER__PASSTHROUGH_FILTER_UINT16_NODE_HPP_ // NOLINT // clang-format on diff --git a/sensing/autoware_pointcloud_preprocessor/launch/ring_passthrough_filter.launch.xml b/sensing/autoware_pointcloud_preprocessor/launch/ring_passthrough_filter.launch.xml index a9ed23e9faa3a..800fa5f3ec3ee 100644 --- a/sensing/autoware_pointcloud_preprocessor/launch/ring_passthrough_filter.launch.xml +++ b/sensing/autoware_pointcloud_preprocessor/launch/ring_passthrough_filter.launch.xml @@ -1,24 +1,16 @@ - - - - - - + + - + + + - - - - - - diff --git a/sensing/autoware_pointcloud_preprocessor/schema/passthrough_filter_uint16_node.schema.json b/sensing/autoware_pointcloud_preprocessor/schema/passthrough_filter_uint16_node.schema.json new file mode 100644 index 0000000000000..ead8137142da0 --- /dev/null +++ b/sensing/autoware_pointcloud_preprocessor/schema/passthrough_filter_uint16_node.schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for Passthrough Filter UInt16 Node", + "type": "object", + "definitions": { + "passthrough_filter_uint16": { + "type": "object", + "properties": { + "filter_limit_min": { + "type": "integer", + "description": "minimum allowed field value", + "default": "0", + "minimum": 0 + }, + "filter_limit_max": { + "type": "integer", + "description": "maximum allowed field value", + "default": "127", + "minimum": 0 + }, + "filter_field_name": { + "type": "string", + "description": "filtering field name", + "default": "channel" + }, + "keep_organized": { + "type": "boolean", + "description": "flag to keep indices structure", + "default": "false" + }, + "filter_limit_negative": { + "type": "boolean", + "description": "flag to return whether the data is inside limit or not", + "default": "false" + } + }, + "required": [ + "filter_limit_min", + "filter_limit_max", + "filter_field_name", + "keep_organized", + "filter_limit_negative" + ], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/passthrough_filter_uint16" + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false +} diff --git a/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_nodelet.cpp b/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_node.cpp similarity index 98% rename from sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_nodelet.cpp rename to sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_node.cpp index 53bb6ad619333..04c1a4cdbcfb2 100644 --- a/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_nodelet.cpp +++ b/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_node.cpp @@ -1,4 +1,4 @@ -// Copyright 2020 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. @@ -48,7 +48,7 @@ * */ -#include "autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_nodelet.hpp" +#include "autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_node.hpp" #include #include diff --git a/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp b/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_node.cpp similarity index 88% rename from sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp rename to sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_node.cpp index cc9f3276033a1..ef4e67696001d 100644 --- a/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp +++ b/sensing/autoware_pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_node.cpp @@ -1,4 +1,4 @@ -// Copyright 2020 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. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_nodelet.hpp" +#include "autoware/pointcloud_preprocessor/passthrough_filter/passthrough_filter_uint16_node.hpp" #include #include @@ -29,15 +29,13 @@ PassThroughFilterUInt16Component::PassThroughFilterUInt16Component( { // set initial parameters { - int filter_min = static_cast(declare_parameter("filter_limit_min", 0)); - int filter_max = static_cast(declare_parameter("filter_limit_max", 127)); + int filter_min = declare_parameter("filter_limit_min"); + int filter_max = declare_parameter("filter_limit_max"); impl_.setFilterLimits(filter_min, filter_max); - impl_.setFilterFieldName( - static_cast(declare_parameter("filter_field_name", "ring"))); - impl_.setKeepOrganized(static_cast(declare_parameter("keep_organized", false))); - impl_.setFilterLimitsNegative( - static_cast(declare_parameter("filter_limit_negative", false))); + impl_.setFilterFieldName(declare_parameter("filter_field_name")); + impl_.setKeepOrganized(declare_parameter("keep_organized")); + impl_.setFilterLimitsNegative(declare_parameter("filter_limit_negative")); } using std::placeholders::_1;