Skip to content

Commit

Permalink
refactor(image_projection_based_fusion): add JSON Schema and remove d…
Browse files Browse the repository at this point in the history
…efault value spefications (autowarefoundation#4902)

* refactor: add JSON Schema and remove default values in `declare_parameter()`

Signed-off-by: ktro2828 <[email protected]>

* refactor: update configuration file

Signed-off-by: ktro2828 <[email protected]>

* refactor: add configuration file and update launcher to load this

Signed-off-by: ktro2828 <[email protected]>

* refactor: update funsion node configuration

Signed-off-by: ktro2828 <[email protected]>

* docs: update the document for roi cluster fusion

Signed-off-by: ktro2828 <[email protected]>

* docs: update documents

Signed-off-by: ktro2828 <[email protected]>

* refactor: move `debug_mode` into `roi_sync.param.yaml`

Signed-off-by: ktro2828 <[email protected]>

* refactor: rework parameters for `roi_pointcloud_fusion`

Signed-off-by: ktro2828 <[email protected]>

* chore: update maintainers

Signed-off-by: ktro2828 <[email protected]>

* refactor: remove debug_mode

Signed-off-by: ktro2828 <[email protected]>

* refactor: rename parameter to avoid failure of spell-check

Signed-off-by: ktro2828 <[email protected]>

* fix: fix typo and parameters for initialization

Signed-off-by: ktro2828 <[email protected]>

---------

Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored and karishma1911 committed May 28, 2024
1 parent 4800c23 commit b7ca100
Show file tree
Hide file tree
Showing 18 changed files with 1,510 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
/**:
ros__parameters:
class_names: ["CAR", "TRUCK", "BUS", "BICYCLE", "PEDESTRIAN"]
paint_class_names: ["CAR", "BICYCLE", "PEDESTRIAN"]
point_feature_size: 7 # x, y, z, time-lag and car, pedestrian, bicycle
max_voxel_size: 40000
point_cloud_range: [-121.6, -76.8, -3.0, 121.6, 76.8, 5.0]
voxel_size: [0.32, 0.32, 8.0]
downsample_factor: 1
encoder_in_feature_size: 12
yaw_norm_thresholds: [0.3, 0.3, 0.3, 0.3, 0.0]
# post-process params
circle_nms_dist_threshold: 0.3
iou_nms_target_class_names: ["CAR"]
iou_nms_search_distance_2d: 10.0
iou_nms_threshold: 0.1
# omp params
omp_num_threads: 1
model_params:
class_names: ["CAR", "TRUCK", "BUS", "BICYCLE", "PEDESTRIAN"]
paint_class_names: ["CAR", "BICYCLE", "PEDESTRIAN"]
point_feature_size: 7 # x, y, z, time-lag and car, pedestrian, bicycle
max_voxel_size: 40000
point_cloud_range: [-121.6, -76.8, -3.0, 121.6, 76.8, 5.0]
voxel_size: [0.32, 0.32, 8.0]
downsample_factor: 1
encoder_in_feature_size: 12
yaw_norm_thresholds: [0.3, 0.3, 0.3, 0.3, 0.0]
has_twist: false
densification_params:
world_frame_id: "map"
num_past_frames: 0
post_process_params:
# post-process params
circle_nms_dist_threshold: 0.3
iou_nms_target_class_names: ["CAR"]
iou_nms_search_distance_2d: 10.0
iou_nms_threshold: 0.1
score_threshold: 0.4
omp_params:
# omp params
num_threads: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**:
ros__parameters:
fusion_distance: 100.0
trust_object_distance: 100.0
trust_object_iou_mode: "iou"
non_trust_object_iou_mode: "iou_x"
use_cluster_semantic_type: false
only_allow_inside_cluster: true
roi_scale_factor: 1.1
iou_threshold: 0.65
unknown_iou_threshold: 0.1
remove_unknown: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**:
ros__parameters:
fuse_unknown_only: true
min_cluster_size: 2
cluster_2d_tolerance: 0.5
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
input_offset_ms: [61.67, 111.67, 45.0, 28.33, 78.33, 95.0]
timeout_ms: 70.0
match_threshold_ms: 50.0
image_buffer_size: 15
debug_mode: false
filter_scope_min_x: -100.0
filter_scope_min_y: -100.0
filter_scope_min_z: -100.0
filter_scope_max_x: 100.0
filter_scope_max_y: 100.0
filter_scope_max_z: 100.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ The clusters are projected onto image planes, and then if the ROIs of clusters a

## Parameters

The following figure is an inner pipeline overview of RoI cluster fusion node.
Please refer to it for your parameter settings.

![roi_cluster_fusion_pipeline](./images/roi_cluster_fusion_pipeline.svg)

### Core Parameters

| Name | Type | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<arg name="input_rois_number" default="$(var input/rois_number)"/>

<!-- debug -->
<arg name="debug_mode" default="false"/>
<arg name="input/image0" default="/image_raw0"/>
<arg name="input/image1" default="/image_raw1"/>
<arg name="input/image2" default="/image_raw2"/>
Expand All @@ -43,9 +42,6 @@
<node pkg="image_projection_based_fusion" exec="pointpainting_fusion_node" name="pointpainting" output="screen">
<remap from="~/input/pointcloud" to="$(var input/pointcloud)"/>
<remap from="~/output/objects" to="$(var output/objects)"/>
<param name="score_threshold" value="0.35"/>
<param name="densification_world_frame_id" value="map"/>
<param name="densification_num_past_frames" value="1"/>
<param name="trt_precision" value="fp16"/>
<param name="encoder_onnx_path" value="$(var model_path)/pts_voxel_encoder_$(var model_name).onnx"/>
<param name="encoder_engine_path" value="$(var model_path)/pts_voxel_encoder_$(var model_name).engine"/>
Expand Down Expand Up @@ -82,9 +78,6 @@
<param name="input/rois7" value="$(var input/rois7)"/>
<param name="input/camera_info7" value="$(var input/camera_info7)"/>
<param name="input/image7" value="$(var input/image7)"/>

<!-- debug -->
<param name="debug_mode" value="$(var debug_mode)"/>
</node>
</group>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,11 @@
<arg name="input/camera_info7" default="/camera_info7"/>
<arg name="input/clusters" default="clusters"/>
<arg name="output/clusters" default="labeled_clusters"/>
<arg name="param_path" default="$(find-pkg-share image_projection_based_fusion)/config/roi_cluster_fusion.param.yaml"/>
<arg name="sync_param_path" default="$(find-pkg-share image_projection_based_fusion)/config/roi_sync.param.yaml"/>
<arg name="remove_unknown" default="true"/>
<arg name="fusion_distance" default="100.0"/>
<arg name="trust_object_distance" default="100.0"/>

<!-- for eval variable-->
<arg name="input_rois_number" default="$(var input/rois_number)"/>

<!-- debug -->
<!-- cspell: ignore minx, maxx, miny, maxy, minz, maxz -->
<arg name="debug_mode" default="false"/>
<arg name="filter_scope_minx" default="-100"/>
<arg name="filter_scope_maxx" default="100"/>
<arg name="filter_scope_miny" default="-100"/>
<arg name="filter_scope_maxy" default="100"/>
<arg name="filter_scope_minz" default="-100"/>
<arg name="filter_scope_maxz" default="100"/>
<arg name="image_buffer_size" default="15"/>
<arg name="input/image0" default="/image_raw0"/>
<arg name="input/image1" default="/image_raw1"/>
<arg name="input/image2" default="/image_raw2"/>
Expand All @@ -46,17 +33,8 @@
<arg name="input/image7" default="/image_raw7"/>
<group>
<node pkg="image_projection_based_fusion" exec="roi_cluster_fusion_node" name="roi_cluster_fusion" output="screen">
<param name="trust_object_iou_mode" value="iou"/>
<param name="non_trust_object_iou_mode" value="iou_x"/>
<param name="use_cluster_semantic_type" value="false"/>
<param name="only_allow_inside_cluster" value="true"/>
<param name="roi_scale_factor" value="1.1"/>
<param name="iou_threshold" value="0.65"/>
<param name="unknown_iou_threshold" value="0.1"/>
<param name="rois_number" value="$(var input/rois_number)"/>
<param name="remove_unknown" value="$(var remove_unknown)"/>
<param name="fusion_distance" value="$(var fusion_distance)"/>
<param name="trust_object_distance" value="$(var trust_object_distance)"/>
<param from="$(var param_path)"/>
<param from="$(var sync_param_path)"/>
<remap from="input" to="$(var input/clusters)"/>
<remap from="output" to="$(var output/clusters)"/>
Expand Down Expand Up @@ -86,16 +64,6 @@
<param name="input/rois7" value="$(var input/rois7)"/>
<param name="input/camera_info7" value="$(var input/camera_info7)"/>
<param name="input/image7" value="$(var input/image7)"/>

<!-- debug -->
<param name="debug_mode" value="$(var debug_mode)"/>
<param name="filter_scope_minx" value="$(var filter_scope_minx)"/>
<param name="filter_scope_maxx" value="$(var filter_scope_maxx)"/>
<param name="filter_scope_miny" value="$(var filter_scope_miny)"/>
<param name="filter_scope_maxy" value="$(var filter_scope_maxy)"/>
<param name="filter_scope_minz" value="$(var filter_scope_minz)"/>
<param name="filter_scope_maxz" value="$(var filter_scope_maxz)"/>
<param name="image_buffer_size" value="$(var image_buffer_size)"/>
</node>
</group>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
<arg name="input_rois_number" default="$(var input/rois_number)"/>

<!-- debug -->
<arg name="debug_mode" default="false"/>
<arg name="image_buffer_size" default="15"/>
<arg name="input/image0" default="/image_raw0"/>
<arg name="input/image1" default="/image_raw1"/>
<arg name="input/image2" default="/image_raw2"/>
Expand Down Expand Up @@ -69,10 +67,6 @@
<param name="input/rois7" value="$(var input/rois7)"/>
<param name="input/camera_info7" value="$(var input/camera_info7)"/>
<param name="input/image7" value="$(var input/image7)"/>

<!-- debug -->
<param name="debug_mode" value="$(var debug_mode)"/>
<param name="image_buffer_size" value="$(var image_buffer_size)"/>
</node>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<launch>
<arg name="input/rois_number" default="6"/>
<arg name="cluster_2d_tolerance" default="0.5"/>
<arg name="min_cluster_size" default="2"/>
<arg name="fuse_unknown_only" default="true"/>
<arg name="input/rois0" default="rois0"/>
<arg name="input/camera_info0" default="/camera_info0"/>
<arg name="input/rois1" default="rois1"/>
Expand All @@ -23,6 +20,7 @@
<arg name="output/pointcloud" default="roi_pointcloud_fusion/output/pointcloud"/>
<arg name="output_clusters" default="output_clusters"/>
<arg name="debug/clusters" default="roi_pointcloud_fusion/debug/clusters"/>
<arg name="param_path" default="$(find-pkg-share image_projection_based_fusion)/config/roi_pointcloud_fusion.param.yaml"/>
<arg name="sync_param_path" default="$(find-pkg-share image_projection_based_fusion)/config/roi_sync.param.yaml"/>

<!-- for eval variable-->
Expand All @@ -38,9 +36,7 @@
<group>
<node pkg="image_projection_based_fusion" exec="roi_pointcloud_fusion_node" name="roi_pointcloud_fusion" output="screen">
<param name="rois_number" value="$(var input/rois_number)"/>
<param name="cluster_2d_tolerance" value="$(var cluster_2d_tolerance)"/>
<param name="min_cluster_size" value="$(var min_cluster_size)"/>
<param name="fuse_unknown_only" value="$(var fuse_unknown_only)"/>
<param from="$(var param_path)"/>
<param from="$(var sync_param_path)"/>
<remap from="input" to="$(var input/pointcloud)"/>
<remap from="output" to="$(var output/pointcloud)"/>
Expand Down
2 changes: 2 additions & 0 deletions perception/image_projection_based_fusion/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<maintainer email="[email protected]">Shunsuke Miura</maintainer>
<maintainer email="[email protected]">Yoshi Ri</maintainer>
<maintainer email="[email protected]">badai nguyen</maintainer>
<maintainer email="[email protected]">Kotaro Uetake</maintainer>
<maintainer email="[email protected]">Tao Zhong</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Point Painting Fusion Node",
"type": "object",
"definitions": {
"pointpainting": {
"type": "object",
"properties": {
"model_params": {
"type": "object",
"description": "Parameters for model configuration.",
"properties": {
"class_names": {
"type": "array",
"description": "An array of class names will be predicted.",
"default": ["CAR", "TRUCK", "BUS", "BICYCLE", "PEDESTRIAN"],
"uniqueItems": true
},
"paint_class_names": {
"type": "array",
"description": "An array of class names will be painted by PointPainting",
"default": ["CAR", "BICYCLE", "PEDESTRIAN"],
"uniqueItems": true
},
"point_feature_size": {
"type": "integer",
"description": "A number of channels of point feature layer.",
"default": 7
},
"max_voxel_size": {
"type": "integer",
"description": "A maximum size of voxel grid.",
"default": 40000
},
"point_cloud_range": {
"type": "array",
"description": "An array of distance ranges of each class, this must have same length with `class_names`.",
"default": [-121.6, -76.8, -3.0, 121.6, 76.8, 5.0]
},
"voxel_size": {
"type": "array",
"description": "An array of voxel grid sizes for PointPainting, this must have same length with `paint_class_names`.",
"default": [0.32, 0.32, 8.0]
},
"down_sample_factor": {
"type": "integer",
"description": "A scale factor of downsampling points",
"default": 1,
"minimum": 1
},
"encoder_in_feature_size": {
"type": "integer",
"description": "A size of encoder input feature channels.",
"default": 12
},
"yaw_norm_thresholds": {
"type": "array",
"description": "An array of distance threshold values of norm of yaw [rad].",
"default": [0.3, 0.3, 0.3, 0.3, 0.0],
"minimum": 0.0,
"maximum": 1.0
},
"has_twist": {
"type": "boolean",
"description": "Indicates whether the model outputs twist value.",
"default": false
}
}
},
"densification_params": {
"type": "object",
"description": "Parameters for pointcloud densification.",
"properties": {
"world_frame_id": {
"type": "string",
"description": "A name of frame id where world coordinates system is defined with respect to.",
"default": "map"
},
"num_past_frames": {
"type": "integer",
"description": "A number of past frames to be considered as same input frame.",
"default": 0,
"minimum": 0
}
}
},
"post_process_params": {
"type": "object",
"properties": {
"score_threshold": {
"type": "number",
"description": "A threshold value of existence probability score, all of objects with score less than this threshold are ignored.",
"default": 0.4,
"minimum": 0.0,
"maximum": 1.0
},
"circle_nms_dist_threshold": {
"type": "number",
"description": "",
"default": 0.3,
"minimum": 0.0,
"maximum": 1.0
},
"iou_nms_target_class_names": {
"type": "array",
"description": "An array of class names to be target in NMS.",
"default": ["CAR"],
"uniqueItems": true
},
"iou_search_distance_2d": {
"type": "number",
"description": "A maximum distance value to search the nearest objects.",
"default": 10.0,
"minimum": 0.0
},
"iou_nms_threshold": {
"type": "number",
"description": "A threshold value of NMS using IoU score.",
"default": 0.1,
"minimum": 0.0,
"maximum": 1.0
}
}
},
"omp_params": {
"type": "object",
"properties": {
"num_threads": {
"type": "integer",
"description": "The number of threads that is set to the environment variable OMP_NUM_THREADS.",
"default": 1,
"minimum": 1
}
}
}
},
"required": ["model_params", "densification_params", "post_process_params", "omp_params"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/pointpainting"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Loading

0 comments on commit b7ca100

Please sign in to comment.