Skip to content

Commit cbfd004

Browse files
committed
Rework params
Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>
1 parent 7908a4a commit cbfd004

6 files changed

+110
-132
lines changed

perception/elevation_map_loader/README.md

+1-78
Original file line numberDiff line numberDiff line change
@@ -41,81 +41,4 @@ Cells with No elevation value can be inpainted using the values of neighboring c
4141

4242
## Parameters
4343

44-
### Node parameters
45-
46-
| Name | Type | Description | Default value |
47-
| :-------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
48-
| map_layer_name | std::string | elevation_map layer name | elevation |
49-
| param_file_path | std::string | GridMap parameters config | path_default |
50-
| elevation_map_directory | std::string | elevation_map file (bag2) | path_default |
51-
| map_frame | std::string | map_frame when loading elevation_map file | map |
52-
| use_inpaint | bool | Whether to inpaint empty cells | true |
53-
| inpaint_radius | float | Radius of a circular neighborhood of each point inpainted that is considered by the algorithm [m] | 0.3 |
54-
| use_elevation_map_cloud_publisher | bool | Whether to publish `output/elevation_map_cloud` | false |
55-
| use_lane_filter | bool | Whether to filter elevation_map with vector_map | false |
56-
| 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 |
57-
| use_sequential_load | bool | Whether to get point cloud map by service | false |
58-
| 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 |
59-
60-
### GridMap parameters
61-
62-
The parameters are described on `config/elevation_map_parameters.yaml`.
63-
64-
#### General parameters
65-
66-
| Name | Type | Description | Default value |
67-
| :--------------------------------------------- | :--- | :----------------------------------------------------------------------------------------------------------- | :------------ |
68-
| 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 |
69-
70-
#### Grid map parameters
71-
72-
See: <https://github.com/ANYbotics/grid_map/tree/ros2/grid_map_pcl>
73-
74-
Resulting grid map parameters.
75-
76-
| Name | Type | Description | Default value |
77-
| :------------------------------------------------------- | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
78-
| 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 |
79-
| pcl_grid_map_extraction/grid_map/resolution | float | Resolution of the grid map. Width and length are computed automatically. | 0.3 |
80-
| 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 |
81-
| pcl_grid_map_extraction/grid_map/height_thresh | float | Height range from the smallest cluster (Only for height_type 1) | 1.0 |
82-
83-
### Point Cloud Pre-processing Parameters
84-
85-
#### Rigid body transform parameters
86-
87-
Rigid body transform that is applied to the point cloud before computing elevation.
88-
89-
| Name | Type | Description | Default value |
90-
| :-------------------------------------------------- | :---- | :---------------------------------------------------------------------------------------------------------------------- | :------------ |
91-
| pcl_grid_map_extraction/cloud_transform/translation | float | Translation (xyz) that is applied to the input point cloud before computing elevation. | 0.0 |
92-
| 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 |
93-
94-
#### Cluster extraction parameters
95-
96-
Cluster extraction is based on pcl algorithms. See <https://pointclouds.org/documentation/tutorials/cluster_extraction.html> for more details.
97-
98-
| Name | Type | Description | Default value |
99-
| :----------------------------------------------------------- | :---- | :------------------------------------------------------------------------------------- | :------------ |
100-
| 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 |
101-
| 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 |
102-
| 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 |
103-
104-
#### Outlier removal parameters
105-
106-
See <https://pointclouds.org/documentation/tutorials/statistical_outlier.html> for more explanation on outlier removal.
107-
108-
| Name | Type | Description | Default value |
109-
| :--------------------------------------------------------- | :---- | :----------------------------------------------------------------------------- | :------------ |
110-
| pcl_grid_map_extraction/outlier_removal/is_remove_outliers | float | Whether to perform statistical outlier removal. | false |
111-
| pcl_grid_map_extraction/outlier_removal/mean_K | float | Number of neighbors to analyze for estimating statistics of a point. | 10 |
112-
| pcl_grid_map_extraction/outlier_removal/stddev_threshold | float | Number of standard deviations under which points are considered to be inliers. | 1.0 |
113-
114-
#### Subsampling parameters
115-
116-
See <https://pointclouds.org/documentation/tutorials/voxel_grid.html> for more explanation on point cloud downsampling.
117-
118-
| Name | Type | Description | Default value |
119-
| :------------------------------------------------------- | :---- | :-------------------------------------- | :------------ |
120-
| pcl_grid_map_extraction/downsampling/is_downsample_cloud | bool | Whether to perform downsampling or not. | false |
121-
| pcl_grid_map_extraction/downsampling/voxel_size | float | Voxel sizes (xyz) in meters. | 0.02 |
44+
{{ json_to_markdown("perception/elevation_map_loader/schema/elevation_map_loader.schema.json") }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**:
2+
ros__parameters:
3+
map_layer_name: "elevation"
4+
param_file_path: "path_default"
5+
map_frame: "map"
6+
use_sequential_load: true
7+
sequential_map_load_num: 1
8+
use_inpaint: true
9+
inpaint_radius: 0.3
10+
use_elevation_map_cloud_publisher: false
11+
elevation_map_directory: "path_default"
12+
use_lane_filter: false
13+
lane_margin: 0.0

perception/elevation_map_loader/config/elevation_map_parameters.yaml

-30
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
<launch>
2-
<arg name="elevation_map_directory" default="$(find-pkg-share elevation_map_loader)/data/elevation_maps"/>
3-
<arg name="param_file_path" default="$(find-pkg-share elevation_map_loader)/config/elevation_map_parameters.yaml"/>
4-
<arg name="use_lane_filter" default="false"/>
5-
<arg name="use_sequential_load" default="false"/>
6-
<arg name="sequential_map_load_num" default="1"/>
7-
<arg name="use_inpaint" default="true"/>
8-
<arg name="inpaint_radius" default="1.0"/>
2+
<arg name="param_file_path" default="$(find-pkg-share elevation_map_loader)/config/elevation_map_loader.param.yaml"/>
93

104
<node pkg="elevation_map_loader" exec="elevation_map_loader" name="elevation_map_loader" output="screen">
115
<remap from="output/elevation_map" to="/map/elevation_map"/>
126
<remap from="input/pointcloud_map" to="/map/pointcloud_map"/>
137
<remap from="input/pointcloud_map_metadata" to="/map/pointcloud_map_metadata"/>
148
<remap from="input/vector_map" to="/map/vector_map"/>
159
<remap from="service/get_selected_pcd_map" to="/map/get_selected_pointcloud_map"/>
16-
17-
<param name="elevation_map_directory" value="$(var elevation_map_directory)"/>
18-
<param name="param_file_path" value="$(var param_file_path)"/>
19-
<param name="use_lane_filter" value="$(var use_lane_filter)"/>
20-
<param name="use_sequential_load" value="$(var use_sequential_load)"/>
21-
<param name="sequential_map_load_num" value="$(var sequential_map_load_num)"/>
10+
<param from="$(var param_file_path)" allow_substs="true"/>
2211
</node>
2312
</launch>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Elevation Map Loader Params",
4+
"type": "object",
5+
"definitions": {
6+
"elevation_map_loader": {
7+
"type": "object",
8+
"properties": {
9+
"map_layer_name": {
10+
"type": "string",
11+
"description": "elevation_map layer name",
12+
"default": "elevation"
13+
},
14+
"param_file_path": {
15+
"type": "string",
16+
"description": "GridMap parameters config",
17+
"default": "path_default"
18+
},
19+
"map_frame": {
20+
"type": "string",
21+
"description": "map_frame when loading elevation_map file",
22+
"default": "map"
23+
},
24+
"use_sequential_load": {
25+
"type": "boolean",
26+
"description": "Whether to get point cloud map by service",
27+
"default": true
28+
},
29+
"sequential_map_load_num": {
30+
"type": "integer",
31+
"description": "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",
32+
"default": 1
33+
},
34+
"use_inpaint": {
35+
"type": "boolean",
36+
"description": "Whether to inpaint empty cells",
37+
"default": true
38+
},
39+
"inpaint_radius": {
40+
"type": "number",
41+
"description": "Radius of a circular neighborhood of each point inpainted that is considered by the algorithm [m]",
42+
"default": 0.3
43+
},
44+
"use_elevation_map_cloud_publisher": {
45+
"type": "boolean",
46+
"description": "Whether to publish `output/elevation_map_cloud`",
47+
"default": false
48+
},
49+
"elevation_map_directory": {
50+
"type": "string",
51+
"description": "elevation_map file (bag2)",
52+
"default": "path_default"
53+
},
54+
"use_lane_filter": {
55+
"type": "boolean",
56+
"description": "Whether to filter elevation_map with vector_map",
57+
"default": false
58+
},
59+
"lane_margin": {
60+
"type": "number",
61+
"description": "Margin distance from the lane polygon of the area to be included in the inpainting mask [m]. Used only when use_lane_filter=True",
62+
"default": 0.0
63+
}
64+
},
65+
"required": ["elevation_map_loader", "map_layer_name", "param_file_path", "map_frame", "use_sequential_load", "sequential_map_load_num", "use_inpaint", "inpaint_radius", "use_elevation_map_cloud_publisher", "elevation_map_directory", "use_lane_filter", "lane_margin"],
66+
"additionalProperties": false
67+
}
68+
},
69+
"properties": {
70+
"/**": {
71+
"type": "object",
72+
"properties": {
73+
"ros__parameters": {
74+
"$ref": "#/definitions/elevation_map_loader"
75+
}
76+
},
77+
"required": ["ros__parameters"],
78+
"additionalProperties": false
79+
}
80+
},
81+
"required": ["/**"],
82+
"additionalProperties": false
83+
}

perception/elevation_map_loader/src/elevation_map_loader_node.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,26 @@
5858
ElevationMapLoaderNode::ElevationMapLoaderNode(const rclcpp::NodeOptions & options)
5959
: Node("elevation_map_loader", options)
6060
{
61-
layer_name_ = this->declare_parameter("map_layer_name", std::string("elevation"));
62-
param_file_path_ = this->declare_parameter("param_file_path", "path_default");
63-
map_frame_ = this->declare_parameter("map_frame", "map");
64-
bool use_sequential_load = this->declare_parameter<bool>("use_sequential_load", true);
65-
int sequential_map_load_num_int = this->declare_parameter<int>("sequential_map_load_num", 1);
61+
layer_name_ = this->declare_parameter<std::string>("map_layer_name");
62+
param_file_path_ = this->declare_parameter<std::string>("param_file_path");
63+
map_frame_ = this->declare_parameter<std::string>("map_frame");
64+
bool use_sequential_load = this->declare_parameter<bool>("use_sequential_load");
65+
int sequential_map_load_num_int = this->declare_parameter<int>("sequential_map_load_num");
6666
if (sequential_map_load_num_int > 0) {
6767
sequential_map_load_num_ = (unsigned int)sequential_map_load_num_int;
6868
} else {
6969
throw std::runtime_error("sequential_map_load_num should be larger than 0.");
7070
}
71-
use_inpaint_ = this->declare_parameter("use_inpaint", true);
72-
inpaint_radius_ = this->declare_parameter("inpaint_radius", 0.3);
71+
use_inpaint_ = this->declare_parameter<bool>("use_inpaint");
72+
inpaint_radius_ = this->declare_parameter<double>("inpaint_radius");
7373
use_elevation_map_cloud_publisher_ =
74-
this->declare_parameter("use_elevation_map_cloud_publisher", false);
75-
elevation_map_directory_ = this->declare_parameter("elevation_map_directory", "path_default");
76-
const bool use_lane_filter = this->declare_parameter("use_lane_filter", false);
74+
this->declare_parameter<bool>("use_elevation_map_cloud_publisher");
75+
elevation_map_directory_ = this->declare_parameter<std::string>("elevation_map_directory");
76+
const bool use_lane_filter = this->declare_parameter<bool>("use_lane_filter");
7777
data_manager_.use_lane_filter_ = use_lane_filter;
7878

7979
lane_filter_.use_lane_filter_ = use_lane_filter;
80-
lane_filter_.lane_margin_ = this->declare_parameter("lane_margin", 0.0);
80+
lane_filter_.lane_margin_ = this->declare_parameter<double>("lane_margin");
8181

8282
rclcpp::QoS durable_qos{1};
8383
durable_qos.transient_local();

0 commit comments

Comments
 (0)