diff --git a/perception/object_merger/README.md b/perception/object_merger/README.md index ca7f533a2c1f1..f9d8c91b2a4c1 100644 --- a/perception/object_merger/README.md +++ b/perception/object_merger/README.md @@ -25,16 +25,9 @@ The successive shortest path algorithm is used to solve the data association pro ## Parameters -| Name | Type | Description | -| --------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `can_assign_matrix` | double | Assignment table for data association | -| `max_dist_matrix` | double | Maximum distance table for data association | -| `max_area_matrix` | double | Maximum area table for data association | -| `min_area_matrix` | double | Minimum area table for data association | -| `max_rad_matrix` | double | Maximum angle table for data association | -| `base_link_frame_id` | double | association frame | -| `distance_threshold_list` | `std::vector` | Distance threshold for each class used in judging overlap. The class order depends on [ObjectClassification](https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_perception_msgs/msg/ObjectClassification.msg). | -| `generalized_iou_threshold` | `std::vector` | Generalized IoU threshold for each class | +{{ json_to_markdown("perception/object_merger/schema/object_association_merger.schema.json") }} +{{ json_to_markdown("perception/object_merger/schema/data_association_matrix.schema.json") }} +{{ json_to_markdown("perception/object_merger/schema/overlapped_judge.schema.json") }} ## Tips diff --git a/perception/object_merger/config/object_association_merger.param.yaml b/perception/object_merger/config/object_association_merger.param.yaml index 5e5dafad5d573..e9b86cd64be29 100644 --- a/perception/object_merger/config/object_association_merger.param.yaml +++ b/perception/object_merger/config/object_association_merger.param.yaml @@ -2,4 +2,7 @@ ros__parameters: sync_queue_size: 20 precision_threshold_to_judge_overlapped: 0.4 + recall_threshold_to_judge_overlapped: 0.5 remove_overlapped_unknown_objects: true + base_link_frame_id: base_link + priority_mode: 3 # PriorityMode::Confidence diff --git a/perception/object_merger/schema/data_association_matrix.schema.json b/perception/object_merger/schema/data_association_matrix.schema.json new file mode 100644 index 0000000000000..68dc977224ba5 --- /dev/null +++ b/perception/object_merger/schema/data_association_matrix.schema.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Data Association Matrix Parameters", + "type": "object", + "properties": { + "ros__parameters": { + "type": "object", + "properties": { + "can_assign_matrix": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Assignment table for data association" + }, + "max_dist_matrix": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Maximum distance table for data association" + }, + "max_rad_matrix": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Maximum angle table for data association. If value is greater than pi, it will be ignored." + }, + "min_iou_matrix": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Minimum IoU threshold matrix for data association. If value is negative, it will be ignored." + } + }, + "required": ["can_assign_matrix", "max_dist_matrix", "max_rad_matrix", "min_iou_matrix"] + } + } +} diff --git a/perception/object_merger/schema/object_association_merger.schema.json b/perception/object_merger/schema/object_association_merger.schema.json new file mode 100644 index 0000000000000..11090fab9c7b3 --- /dev/null +++ b/perception/object_merger/schema/object_association_merger.schema.json @@ -0,0 +1,63 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for Object Association Merger Node", + "type": "object", + "definitions": { + "object_association_merger": { + "type": "object", + "properties": { + "sync_queue_size": { + "type": "integer", + "description": "The size of the synchronization queue.", + "default": 20 + }, + "precision_threshold_to_judge_overlapped": { + "type": "number", + "description": "The precision threshold to judge if objects are overlapped.", + "default": 0.4 + }, + "recall_threshold_to_judge_overlapped": { + "type": "number", + "description": "The recall threshold to judge if objects are overlapped.", + "default": 0.5 + }, + "remove_overlapped_unknown_objects": { + "type": "boolean", + "description": "Flag to remove overlapped unknown objects.", + "default": true + }, + "base_link_frame_id": { + "type": "string", + "description": "The frame ID of the association frame.", + "default": "base_link" + }, + "priority_mode": { + "type": "integer", + "description": "Index for the priority_mode.", + "default": 3, + "enum": [0, 1, 2, 3] + } + }, + "required": [ + "sync_queue_size", + "precision_threshold_to_judge_overlapped", + "recall_threshold_to_judge_overlapped", + "remove_overlapped_unknown_objects", + "base_link_frame_id", + "priority_mode" + ] + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/object_association_merger" + } + }, + "required": ["ros__parameters"] + } + }, + "required": ["/**"] +} diff --git a/perception/object_merger/schema/overlapped_judge.schema.json b/perception/object_merger/schema/overlapped_judge.schema.json new file mode 100644 index 0000000000000..b65464c6201d1 --- /dev/null +++ b/perception/object_merger/schema/overlapped_judge.schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Overlapped Judge Parameters", + "type": "object", + "properties": { + "ros__parameters": { + "type": "object", + "properties": { + "distance_threshold_list": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Distance threshold for each class used in judging overlap." + }, + "generalized_iou_threshold": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Generalized IoU threshold for each class." + } + }, + "required": ["distance_threshold_list", "generalized_iou_threshold"] + } + } +} diff --git a/perception/object_merger/src/object_association_merger/node.cpp b/perception/object_merger/src/object_association_merger/node.cpp index 5077268731955..2b806382382cf 100644 --- a/perception/object_merger/src/object_association_merger/node.cpp +++ b/perception/object_merger/src/object_association_merger/node.cpp @@ -80,16 +80,14 @@ ObjectAssociationMergerNode::ObjectAssociationMergerNode(const rclcpp::NodeOptio object1_sub_(this, "input/object1", rclcpp::QoS{1}.get_rmw_qos_profile()) { // Parameters - base_link_frame_id_ = declare_parameter("base_link_frame_id", "base_link"); - priority_mode_ = static_cast( - declare_parameter("priority_mode", static_cast(PriorityMode::Confidence))); - sync_queue_size_ = declare_parameter("sync_queue_size", 20); - remove_overlapped_unknown_objects_ = - declare_parameter("remove_overlapped_unknown_objects", true); + base_link_frame_id_ = declare_parameter("base_link_frame_id"); + priority_mode_ = static_cast(declare_parameter("priority_mode")); + sync_queue_size_ = declare_parameter("sync_queue_size"); + remove_overlapped_unknown_objects_ = declare_parameter("remove_overlapped_unknown_objects"); overlapped_judge_param_.precision_threshold = declare_parameter("precision_threshold_to_judge_overlapped"); overlapped_judge_param_.recall_threshold = - declare_parameter("recall_threshold_to_judge_overlapped", 0.5); + declare_parameter("recall_threshold_to_judge_overlapped"); overlapped_judge_param_.generalized_iou_threshold = convertListToClassMap(declare_parameter>("generalized_iou_threshold"));