Skip to content

Commit dbd1389

Browse files
tby-udelpre-commit-ci[bot]
authored and
chtseng
committed
refactor(probabilistic_occupancy_grid_map): rework parameters (autowarefoundation#7339)
* refactor(probabilistic_occupancy_grid_map): rework parameters Signed-off-by: Boyang <tby@udel.edu> * style(pre-commit): autofix * Solved the CI's complainment Signed-off-by: Boyang <tby@udel.edu> --------- Signed-off-by: Boyang <tby@udel.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: chtseng <chtseng@itri.org.tw>
1 parent 63e20f3 commit dbd1389

8 files changed

+701
-52
lines changed

perception/probabilistic_occupancy_grid_map/README.md

+8-52
Original file line numberDiff line numberDiff line change
@@ -19,58 +19,14 @@ You may need to choose `scan_origin_frame` and `gridmap_origin_frame` which mean
1919

2020
![image_for_frame_parameter_visualization](./image/gridmap_frame_settings.drawio.svg)
2121

22-
### Each config parameters
23-
24-
Config parameters are managed in `config/*.yaml` and here shows its outline.
25-
26-
- Pointcloud based occupancy grid map
27-
28-
| Ros param name | Default value |
29-
| -------------------------------------------- | ------------- |
30-
| map_frame | "map" |
31-
| base_link_frame | "base_link" |
32-
| scan_origin_frame | "base_link" |
33-
| gridmap_origin_frame | "base_link" |
34-
| use_height_filter | true |
35-
| enable_single_frame_mode | false |
36-
| filter_obstacle_pointcloud_by_raw_pointcloud | false |
37-
| map_length | 150.0 [m] |
38-
| map_resolution | 0.5 [m] |
39-
| use_projection | false |
40-
| projection_dz_threshold | 0.01 |
41-
| obstacle_separation_threshold | 1.0 |
42-
| input_obstacle_pointcloud | true |
43-
| input_obstacle_and_raw_pointcloud | true |
44-
45-
- Laserscan based occupancy grid map
46-
47-
| Ros param name | Default value |
48-
| ------------------------ | ------------- |
49-
| map_length | 150 [m] |
50-
| map_width | 150 [m] |
51-
| map_resolution | 0.5 [m] |
52-
| use_height_filter | true |
53-
| enable_single_frame_mode | false |
54-
| map_frame | "map" |
55-
| base_link_frame | "base_link" |
56-
| scan_origin_frame | "base_link" |
57-
| gridmap_origin_frame | "base_link" |
58-
59-
## Other parameters
60-
61-
Additional argument is shown below:
62-
63-
| Name | Default | Description |
64-
| ----------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------- |
65-
| `use_multithread` | `false` | whether to use multithread |
66-
| `use_intra_process` | `false` | |
67-
| `map_origin` | `` | parameter to override `map_origin_frame` which means grid map origin |
68-
| `scan_origin` | `` | parameter to override `scan_origin_frame` which means scanning center |
69-
| `output` | `occupancy_grid` | output name |
70-
| `use_pointcloud_container` | `false` | |
71-
| `container_name` | `occupancy_grid_map_container` | |
72-
| `input_obstacle_pointcloud` | `false` | only for laserscan based method. If true, the node subscribe obstacle pointcloud |
73-
| `input_obstacle_and_raw_pointcloud` | `true` | only for laserscan based method. If true, the node subscribe both obstacle and raw pointcloud |
22+
### Parameters
23+
24+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/binary_bayes_filter_updater.schema.json") }}
25+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/grid_map.schema.json") }}
26+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/laserscan_based_occupancy_grid_map.schema.json") }}
27+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/multi_lidar_pointcloud_based_occupancy_grid_map.schema.json") }}
28+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/pointcloud_based_occupancy_grid_map.schema.json") }}
29+
{{ json_to_markdown("perception/probabilistic_occupancy_grid_map/schema/synchronized_grid_map_fusion_node.schema.json") }}
7430

7531
### Downsample input pointcloud(Optional)
7632

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Binary Bayes Filter Updater",
4+
"type": "object",
5+
"definitions": {
6+
"binary_bayes_filter_updater": {
7+
"type": "object",
8+
"properties": {
9+
"probability_matrix": {
10+
"type": "object",
11+
"properties": {
12+
"occupied_to_occupied": {
13+
"type": "number",
14+
"description": "Probability of transitioning from occupied to occupied state.",
15+
"default": 0.95
16+
},
17+
"occupied_to_free": {
18+
"type": "number",
19+
"description": "Probability of transitioning from occupied to free state.",
20+
"default": 0.05
21+
},
22+
"free_to_occupied": {
23+
"type": "number",
24+
"description": "Probability of transitioning from free to occupied state.",
25+
"default": 0.2
26+
},
27+
"free_to_free": {
28+
"type": "number",
29+
"description": "Probability of transitioning from free to free state.",
30+
"default": 0.8
31+
}
32+
},
33+
"required": [
34+
"occupied_to_occupied",
35+
"occupied_to_free",
36+
"free_to_occupied",
37+
"free_to_free"
38+
]
39+
},
40+
"v_ratio": {
41+
"type": "number",
42+
"description": "Ratio of the variance used in the filter.",
43+
"default": 0.1
44+
}
45+
},
46+
"required": ["probability_matrix", "v_ratio"]
47+
}
48+
},
49+
"properties": {
50+
"/**": {
51+
"type": "object",
52+
"properties": {
53+
"ros__parameters": {
54+
"$ref": "#/definitions/binary_bayes_filter_updater"
55+
}
56+
},
57+
"required": ["ros__parameters"]
58+
}
59+
},
60+
"required": ["/**"]
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Grid Map",
4+
"type": "object",
5+
"definitions": {
6+
"visualization_params": {
7+
"type": "object",
8+
"properties": {
9+
"type": {
10+
"type": "string",
11+
"description": "The type of grid map visualization.",
12+
"default": "occupancy_grid"
13+
},
14+
"params": {
15+
"type": "object",
16+
"properties": {
17+
"layer": {
18+
"type": "string",
19+
"description": "The layer of the grid map visualization.",
20+
"default": "filled_free_to_farthest"
21+
},
22+
"data_min": {
23+
"type": "number",
24+
"description": "The minimum data value for the visualization.",
25+
"default": 0.0
26+
},
27+
"data_max": {
28+
"type": "number",
29+
"description": "The maximum data value for the visualization.",
30+
"default": 100.0
31+
}
32+
},
33+
"required": ["layer", "data_min", "data_max"]
34+
}
35+
},
36+
"required": ["type", "params"]
37+
}
38+
},
39+
"properties": {
40+
"/**": {
41+
"type": "object",
42+
"properties": {
43+
"ros__parameters": {
44+
"type": "object",
45+
"properties": {
46+
"grid_map_topic": {
47+
"type": "string",
48+
"description": "The topic name for the grid map.",
49+
"default": "/perception/occupancy_grid_map/occupancy_grid_map_node/debug/grid_map"
50+
},
51+
"grid_map_visualizations": {
52+
"type": "array",
53+
"description": "List of grid map visualizations.",
54+
"items": {
55+
"type": "string"
56+
},
57+
"default": ["grid_1st_step", "grid_2nd_step", "grid_3rd_step"]
58+
},
59+
"grid_1st_step": { "$ref": "#/definitions/visualization_params" },
60+
"grid_2nd_step": { "$ref": "#/definitions/visualization_params" },
61+
"grid_3rd_step": { "$ref": "#/definitions/visualization_params" }
62+
},
63+
"required": [
64+
"grid_map_topic",
65+
"grid_map_visualizations",
66+
"grid_1st_step",
67+
"grid_2nd_step",
68+
"grid_3rd_step"
69+
]
70+
}
71+
},
72+
"required": ["ros__parameters"]
73+
}
74+
},
75+
"required": ["/**"]
76+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Laserscan Based Occupancy Grid Map",
4+
"type": "object",
5+
"definitions": {
6+
"height_filter_params": {
7+
"type": "object",
8+
"properties": {
9+
"use_height_filter": {
10+
"type": "boolean",
11+
"description": "Flag to use height filter.",
12+
"default": true
13+
},
14+
"min_height": {
15+
"type": "number",
16+
"description": "Minimum height for the height filter.",
17+
"default": -1.0
18+
},
19+
"max_height": {
20+
"type": "number",
21+
"description": "Maximum height for the height filter.",
22+
"default": 2.0
23+
}
24+
},
25+
"required": ["use_height_filter", "min_height", "max_height"]
26+
}
27+
},
28+
"properties": {
29+
"/**": {
30+
"type": "object",
31+
"properties": {
32+
"ros__parameters": {
33+
"type": "object",
34+
"properties": {
35+
"map_frame": {
36+
"type": "string",
37+
"description": "The frame ID of the map.",
38+
"default": "map"
39+
},
40+
"base_link_frame": {
41+
"type": "string",
42+
"description": "The frame ID of the base link.",
43+
"default": "base_link"
44+
},
45+
"gridmap_origin_frame": {
46+
"type": "string",
47+
"description": "The frame ID of the grid map origin.",
48+
"default": "base_link"
49+
},
50+
"scan_origin_frame": {
51+
"type": "string",
52+
"description": "The frame ID of the scan origin.",
53+
"default": "base_link"
54+
},
55+
"height_filter": { "$ref": "#/definitions/height_filter_params" },
56+
"enable_single_frame_mode": {
57+
"type": "boolean",
58+
"description": "Flag to enable single frame mode.",
59+
"default": false
60+
},
61+
"map_length": {
62+
"type": "number",
63+
"description": "The length of the map.",
64+
"default": 150.0
65+
},
66+
"map_width": {
67+
"type": "number",
68+
"description": "The width of the map.",
69+
"default": 150.0
70+
},
71+
"map_resolution": {
72+
"type": "number",
73+
"description": "The resolution of the map.",
74+
"default": 0.5
75+
}
76+
},
77+
"required": [
78+
"map_frame",
79+
"base_link_frame",
80+
"gridmap_origin_frame",
81+
"scan_origin_frame",
82+
"height_filter",
83+
"enable_single_frame_mode",
84+
"map_length",
85+
"map_width",
86+
"map_resolution"
87+
]
88+
}
89+
},
90+
"required": ["ros__parameters"]
91+
}
92+
},
93+
"required": ["/**"]
94+
}

0 commit comments

Comments
 (0)