Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(autoware_pointcloud_preprocessor): rework pickup based voxel grid downsample filter parameters #8481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sensing/autoware_pointcloud_preprocessor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ament_auto_add_library(pointcloud_preprocessor_filter SHARED
src/downsample_filter/voxel_grid_downsample_filter_node.cpp
src/downsample_filter/random_downsample_filter_node.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/radius_search_2d_outlier_filter_node.cpp
src/outlier_filter/voxel_grid_outlier_filter_node.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**:
ros__parameters:
voxel_size_x: 1.0
voxel_size_y: 1.0
voxel_size_z: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"

Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<launch>
<arg name="input_topic_name" default="/sensing/lidar/top/pointcloud_raw"/>
<arg name="output_topic_name" default="/sensing/lidar/top/pickup_based_voxel_grid_downsample_filter/pointcloud"/>
<arg name="input_frame" default=""/>
<arg name="output_frame" default=""/>
<arg name="pickup_based_voxel_grid_downsample_filter_param_file" default="$(find-pkg-share autoware_pointcloud_preprocessor)/config/pickup_based_voxel_grid_downsample_filter_node.param.yaml"/>
<arg name="filter_param_file" default="$(find-pkg-share autoware_pointcloud_preprocessor)/config/filter.param.yaml"/>
<node pkg="autoware_pointcloud_preprocessor" exec="pickup_based_voxel_grid_downsample_filter_node" name="pickup_based_voxel_grid_downsample_filter_node">
<param from="$(var pickup_based_voxel_grid_downsample_filter_param_file)"/>
<param from="$(var filter_param_file)"/>
<remap from="input" to="$(var input_topic_name)"/>
<remap from="output" to="$(var output_topic_name)"/>
<param name="input_frame" value="$(var input_frame)"/>
<param name="output_frame" value="$(var output_frame)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$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_filter": {
"type": "object",
"properties": {
"voxel_size_x": {
"type": "number",
"description": "voxel size along the x-axis [m]",
"default": "1.0",
"minimum": 0
},
"voxel_size_y": {
knzo25 marked this conversation as resolved.
Show resolved Hide resolved
"type": "number",
"description": "voxel size along the y-axis [m]",
"default": "1.0",
"minimum": 0
},
"voxel_size_z": {
"type": "number",
"description": "voxel size along the z-axis [m]",
"default": "1.0",
"minimum": 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_filter"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -66,9 +66,9 @@ PickupBasedVoxelGridDownsampleFilterComponent::PickupBasedVoxelGridDownsampleFil
}

// Initialization of voxel sizes from parameters
voxel_size_x_ = static_cast<float>(declare_parameter("voxel_size_x", 1.0));
voxel_size_y_ = static_cast<float>(declare_parameter("voxel_size_y", 1.0));
voxel_size_z_ = static_cast<float>(declare_parameter("voxel_size_z", 1.0));
voxel_size_x_ = declare_parameter<float>("voxel_size_x");
voxel_size_y_ = declare_parameter<float>("voxel_size_y");
voxel_size_z_ = declare_parameter<float>("voxel_size_z");

using std::placeholders::_1;
set_param_res_ = this->add_on_set_parameters_callback(
Expand Down
Loading