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(elevation_map_loader): rework parameters #6678

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
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
69 changes: 14 additions & 55 deletions perception/autoware_elevation_map_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,81 +41,40 @@ Cells with No elevation value can be inpainted using the values of neighboring c

## Parameters

### Node parameters
### Node Parameters

| Name | Type | Description | Default value |
| :-------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| map_layer_name | std::string | elevation_map layer name | elevation |
| param_file_path | std::string | GridMap parameters config | path_default |
| elevation_map_directory | std::string | elevation_map file (bag2) | path_default |
| map_frame | std::string | map_frame when loading elevation_map file | map |
| use_inpaint | bool | Whether to inpaint empty cells | true |
| inpaint_radius | float | Radius of a circular neighborhood of each point inpainted that is considered by the algorithm [m] | 0.3 |
| use_elevation_map_cloud_publisher | bool | Whether to publish `output/elevation_map_cloud` | false |
| use_lane_filter | bool | Whether to filter elevation_map with vector_map | false |
| lane_margin | float | Margin distance from the lane polygon of the area to be included in the inpainting mask [m]. Used only when use_lane_filter=True. | 0.0 |
| use_sequential_load | bool | Whether to get point cloud map by service | false |
| sequential_map_load_num | int | The number of point cloud maps to load at once (only used when use_sequential_load is set true). This should not be larger than number of all point cloud map cells. | 1 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/node.json") }}

### GridMap parameters

The parameters are described on `config/elevation_map_parameters.yaml`.

#### General parameters

| Name | Type | Description | Default value |
| :--------------------------------------------- | :--- | :----------------------------------------------------------------------------------------------------------- | :------------ |
| pcl_grid_map_extraction/num_processing_threads | int | Number of threads for processing grid map cells. Filtering of the raw input point cloud is not parallelized. | 12 |

#### Grid map parameters
### Grid Map Parameters

See: <https://github.com/ANYbotics/grid_map/tree/ros2/grid_map_pcl>

Resulting grid map parameters.

| Name | Type | Description | Default value |
| :------------------------------------------------------- | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| pcl_grid_map_extraction/grid_map/min_num_points_per_cell | int | Minimum number of points in the point cloud that have to fall within any of the grid map cells. Otherwise the cell elevation will be set to NaN. | 3 |
| pcl_grid_map_extraction/grid_map/resolution | float | Resolution of the grid map. Width and length are computed automatically. | 0.3 |
| pcl_grid_map_extraction/grid_map/height_type | int | The parameter that determine the elevation of a cell `0: Smallest value among the average values of each cluster`, `1: Mean value of the cluster with the most points` | 1 |
| pcl_grid_map_extraction/grid_map/height_thresh | float | Height range from the smallest cluster (Only for height_type 1) | 1.0 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/grid_map.json") }}

### Point Cloud Pre-processing Parameters
### Point Cloud Preprocessing Parameters

#### Rigid body transform parameters

Rigid body transform that is applied to the point cloud before computing elevation.

| Name | Type | Description | Default value |
| :-------------------------------------------------- | :---- | :---------------------------------------------------------------------------------------------------------------------- | :------------ |
| pcl_grid_map_extraction/cloud_transform/translation | float | Translation (xyz) that is applied to the input point cloud before computing elevation. | 0.0 |
| pcl_grid_map_extraction/cloud_transform/rotation | float | Rotation (intrinsic rotation, convention X-Y'-Z'') that is applied to the input point cloud before computing elevation. | 0.0 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/cloud_transform_translation.json") }}
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/cloud_transform_rotation.json") }}

#### Cluster extraction parameters
#### Cluster Extraction Parameters

Cluster extraction is based on pcl algorithms. See <https://pointclouds.org/documentation/tutorials/cluster_extraction.html> for more details.

| Name | Type | Description | Default value |
| :----------------------------------------------------------- | :---- | :------------------------------------------------------------------------------------- | :------------ |
| pcl_grid_map_extraction/cluster_extraction/cluster_tolerance | float | Distance between points below which they will still be considered part of one cluster. | 0.2 |
| pcl_grid_map_extraction/cluster_extraction/min_num_points | int | Min number of points that a cluster needs to have (otherwise it will be discarded). | 3 |
| pcl_grid_map_extraction/cluster_extraction/max_num_points | int | Max number of points that a cluster can have (otherwise it will be discarded). | 1000000 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/cluster_extraction.json") }}

#### Outlier removal parameters
#### Outlier Removal Parameters

See <https://pointclouds.org/documentation/tutorials/statistical_outlier.html> for more explanation on outlier removal.

| Name | Type | Description | Default value |
| :--------------------------------------------------------- | :---- | :----------------------------------------------------------------------------- | :------------ |
| pcl_grid_map_extraction/outlier_removal/is_remove_outliers | float | Whether to perform statistical outlier removal. | false |
| pcl_grid_map_extraction/outlier_removal/mean_K | float | Number of neighbors to analyze for estimating statistics of a point. | 10 |
| pcl_grid_map_extraction/outlier_removal/stddev_threshold | float | Number of standard deviations under which points are considered to be inliers. | 1.0 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/outlier_removal.json") }}

#### Subsampling parameters
#### Subsampling Parameters

See <https://pointclouds.org/documentation/tutorials/voxel_grid.html> for more explanation on point cloud downsampling.

| Name | Type | Description | Default value |
| :------------------------------------------------------- | :---- | :-------------------------------------- | :------------ |
| pcl_grid_map_extraction/downsampling/is_downsample_cloud | bool | Whether to perform downsampling or not. | false |
| pcl_grid_map_extraction/downsampling/voxel_size | float | Voxel sizes (xyz) in meters. | 0.02 |
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/downsampling.json") }}
{{ json_to_markdown("perception/autoware_elevation_map_loader/schema/sub/downsampling_voxel_size.json") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**:
ros__parameters:
node:
map_layer_name: "elevation"
param_file_path: "path_default"
map_frame: "map"
use_sequential_load: true
sequential_map_load_num: 1
use_inpaint: true
inpaint_radius: 0.3
use_elevation_map_cloud_publisher: false
elevation_map_directory: "path_default"
use_lane_filter: false
lane_margin: 0.0
cloud_transform:
translation:
x: 0.0
y: 0.0
z: 0.0
rotation: # intrinsic rotation X-Y-Z (r-p-y)sequence
r: 0.0
p: 0.0
y: 0.0
cluster_extraction:
cluster_tolerance: 0.2
min_num_points: 3
max_num_points: 1000000
outlier_removal:
is_remove_outliers: false
mean_K: 10
stddev_threshold: 1.0
downsampling:
is_downsample_cloud: false
voxel_size:
x: 0.02
y: 0.02
z: 0.02
grid_map:
num_processing_threads: 12
min_num_points_per_cell: 3
resolution: 0.3
height_type: 1
height_thresh: 1.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
<launch>
<arg name="elevation_map_directory" default="$(find-pkg-share autoware_elevation_map_loader)/data/elevation_maps"/>
<arg name="param_file_path" default="$(find-pkg-share autoware_elevation_map_loader)/config/elevation_map_parameters.yaml"/>
<arg name="use_lane_filter" default="false"/>
<arg name="use_sequential_load" default="false"/>
<arg name="sequential_map_load_num" default="1"/>
<arg name="use_inpaint" default="true"/>
<arg name="inpaint_radius" default="1.0"/>

<node pkg="autoware_elevation_map_loader" exec="elevation_map_loader_node" name="elevation_map_loader" output="screen">
<remap from="output/elevation_map" to="/map/elevation_map"/>
<remap from="input/pointcloud_map" to="/map/pointcloud_map"/>
<remap from="input/pointcloud_map_metadata" to="/map/pointcloud_map_metadata"/>
<remap from="input/vector_map" to="/map/vector_map"/>
<remap from="service/get_selected_pcd_map" to="/map/get_selected_pointcloud_map"/>

<param name="elevation_map_directory" value="$(var elevation_map_directory)"/>
Copy link
Contributor

@Shin-kyoto Shin-kyoto Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oguzkaganozt

Why do you leave elevation_map_directory arg, although you removed elevation_map_directory param ?

<param name="param_file_path" value="$(var param_file_path)"/>
<param name="use_lane_filter" value="$(var use_lane_filter)"/>
<param name="use_sequential_load" value="$(var use_sequential_load)"/>
<param name="sequential_map_load_num" value="$(var sequential_map_load_num)"/>
<param from="$(var param_file_path)" allow_substs="true"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"type": "object",
"definitions": {
"elevation_map_loader": {
"type": "object",
"properties": {
"node": { "$ref": "sub/node.json#/definitions/node" },
"cloud_transform": { "$ref": "sub/cloud_transform.json#/definitions/cloud_transform" },
"cluster_extraction": {
"$ref": "sub/cluster_extraction.json#/definitions/cluster_extraction"
},
"outlier_removal": { "$ref": "sub/outlier_removal.json#/definitions/outlier_removal" },
"downsampling": { "$ref": "sub/downsampling.json#/definitions/downsampling" },
"grid_map": { "$ref": "sub/grid_map.json#/definitions/grid_map" }
},
"required": [
"node",
"cloud_transform",
"cluster_extraction",
"outlier_removal",
"downsampling",
"grid_map"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/elevation_map_loader"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"definitions": {
"cloud_transform": {
"type": "object",
"properties": {
"translation": { "$ref": "cloud_transform_translation.json#/definitions/translation" },
"rotation": { "$ref": "cloud_transform_rotation.json#/definitions/rotation" }
},
"required": ["translation", "rotation"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"definitions": {
"rotation": {
"type": "object",
"properties": {
"r": {
"type": "number",
"description": "Rotation (intrinsic rotation, convention X-Y'-Z'') that is applied to the input point cloud before computing elevation.",
"default": 0.0,
"$comment": "This is the rotation around the X-axis",
"minimum": -360.0,
"maximum": 360.0
},
"p": {
"type": "number",
"description": "Rotation (intrinsic rotation, convention X-Y'-Z'') that is applied to the input point cloud before computing elevation.",
"default": 0.0,
"$comment": "This is the rotation around the Y-axis",
"minimum": -360.0,
"maximum": 360.0
},
"y": {
"type": "number",
"description": "Rotation (intrinsic rotation, convention X-Y'-Z'') that is applied to the input point cloud before computing elevation.",
"default": 0.0,
"minimum": -360.0,
"maximum": 360.0
}
},
"required": ["r", "p", "y"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"definitions": {
"translation": {
"type": "object",
"properties": {
"x": {
"type": "number",
"description": "Translation (x) that is applied to the input point cloud before computing elevation",
"default": 0.0
},
"y": {
"type": "number",
"description": "Translation (y) that is applied to the input point cloud before computing elevation",
"default": 0.0
},
"z": {
"type": "number",
"description": "Translation (z) that is applied to the input point cloud before computing elevation",
"default": 0.0
}
},
"required": ["x", "y", "z"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"definitions": {
"cluster_extraction": {
"type": "object",
"properties": {
"cluster_tolerance": {
"type": "number",
"description": "Distance between points below which they will still be considered part of one cluster",
"default": 0.2,
"minimum": 0.01
},
"min_num_points": {
"type": "integer",
"description": "Min number of points that a cluster needs to have (otherwise it will be discarded)",
"default": 3,
"minimum": 1
},
"max_num_points": {
"type": "integer",
"description": "Max number of points that a cluster can have (otherwise it will be discarded)",
"default": 1000000
}
},
"required": ["cluster_tolerance", "min_num_points", "max_num_points"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Elevation Map Loader Params",
"definitions": {
"downsampling": {
"type": "object",
"properties": {
"is_downsample_cloud": {
"type": "boolean",
"description": "Whether to perform downsampling or not",
"default": false
},
"voxel_size": { "$ref": "downsampling_voxel_size.json#/definitions/voxel_size" }
},
"required": ["is_downsample_cloud", "voxel_size"],
"additionalProperties": false
}
}
}
Loading
Loading