From 9444f0c5441123035d080a78b4df0f5e509dd149 Mon Sep 17 00:00:00 2001 From: Yuntianyi Chen Date: Wed, 29 Nov 2023 15:49:23 -0800 Subject: [PATCH] refactor(detection_by_tracker): rework parameters (#4989) * refactor the configuration files of the node detection_by_tracker_node according to the new ROS node config guideline. update the parameter information in the README.md Signed-off-by: yuntianyi-chen * style(pre-commit): autofix * revert copyright info Signed-off-by: yuntianyi-chen * style(pre-commit): autofix * update config file Signed-off-by: yuntianyi-chen --------- Signed-off-by: yuntianyi-chen Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> --- .../detection_by_tracker/CMakeLists.txt | 3 +- perception/detection_by_tracker/README.md | 11 +++ .../config/detection_by_tracker.param.yaml | 17 ++--- .../schema/detection_by_tracker.schema.json | 74 +++++++++++++++++++ 4 files changed, 95 insertions(+), 10 deletions(-) create mode 100644 perception/detection_by_tracker/schema/detection_by_tracker.schema.json diff --git a/perception/detection_by_tracker/CMakeLists.txt b/perception/detection_by_tracker/CMakeLists.txt index 51839027e0e41..3813f1ba4707f 100644 --- a/perception/detection_by_tracker/CMakeLists.txt +++ b/perception/detection_by_tracker/CMakeLists.txt @@ -44,7 +44,8 @@ rclcpp_components_register_node(detection_by_tracker_node EXECUTABLE detection_by_tracker ) -ament_auto_package(INSTALL_TO_SHARE +ament_auto_package( + INSTALL_TO_SHARE launch config ) diff --git a/perception/detection_by_tracker/README.md b/perception/detection_by_tracker/README.md index aece084cd319e..0cff97c4d3ab4 100644 --- a/perception/detection_by_tracker/README.md +++ b/perception/detection_by_tracker/README.md @@ -46,6 +46,17 @@ Simply looking at the overlap between the unknown object and the tracker does no ## Parameters +| Name | Type | Description | Default value | +| --------------------------------- | ------ | --------------------------------------------------------------------- | ------------- | +| `tracker_ignore_label.UNKNOWN` | `bool` | If true, the node will ignore the tracker if its label is unknown. | `true` | +| `tracker_ignore_label.CAR` | `bool` | If true, the node will ignore the tracker if its label is CAR. | `false` | +| `tracker_ignore_label.PEDESTRIAN` | `bool` | If true, the node will ignore the tracker if its label is pedestrian. | `false` | +| `tracker_ignore_label.BICYCLE` | `bool` | If true, the node will ignore the tracker if its label is bicycle. | `false` | +| `tracker_ignore_label.MOTORCYCLE` | `bool` | If true, the node will ignore the tracker if its label is MOTORCYCLE. | `false` | +| `tracker_ignore_label.BUS` | `bool` | If true, the node will ignore the tracker if its label is bus. | `false` | +| `tracker_ignore_label.TRUCK` | `bool` | If true, the node will ignore the tracker if its label is truck. | `false` | +| `tracker_ignore_label.TRAILER` | `bool` | If true, the node will ignore the tracker if its label is TRAILER. | `false` | + ## Assumptions / Known limits ## (Optional) Error detection and handling diff --git a/perception/detection_by_tracker/config/detection_by_tracker.param.yaml b/perception/detection_by_tracker/config/detection_by_tracker.param.yaml index 695704050697d..fac8687c5eeb3 100644 --- a/perception/detection_by_tracker/config/detection_by_tracker.param.yaml +++ b/perception/detection_by_tracker/config/detection_by_tracker.param.yaml @@ -1,11 +1,10 @@ /**: ros__parameters: - tracker_ignore_label: - UNKNOWN : true - CAR : false - TRUCK : false - BUS : false - TRAILER : false - MOTORCYCLE : false - BICYCLE : false - PEDESTRIAN : false + tracker_ignore_label.UNKNOWN : true + tracker_ignore_label.CAR : false + tracker_ignore_label.TRUCK : false + tracker_ignore_label.BUS : false + tracker_ignore_label.TRAILER : false + tracker_ignore_label.MOTORCYCLE : false + tracker_ignore_label.BICYCLE : false + tracker_ignore_label.PEDESTRIAN : false diff --git a/perception/detection_by_tracker/schema/detection_by_tracker.schema.json b/perception/detection_by_tracker/schema/detection_by_tracker.schema.json new file mode 100644 index 0000000000000..22c2b4fa15437 --- /dev/null +++ b/perception/detection_by_tracker/schema/detection_by_tracker.schema.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameters for Detection By Tracker Node", + "type": "object", + "definitions": { + "detection_by_tracker": { + "type": "object", + "properties": { + "tracker_ignore_label.UNKNOWN": { + "type": "boolean", + "default": true, + "description": "If true, the node will ignore the tracker if its label is unknown." + }, + "tracker_ignore_label.CAR": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is CAR." + }, + "tracker_ignore_label.PEDESTRIAN": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is pedestrian." + }, + "tracker_ignore_label.BICYCLE": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is bicycle." + }, + "tracker_ignore_label.MOTORCYCLE": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is motorcycle." + }, + "tracker_ignore_label.BUS": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is bus." + }, + "tracker_ignore_label.TRUCK": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is truck." + }, + "tracker_ignore_label.TRAILER": { + "type": "boolean", + "default": false, + "description": "If true, the node will ignore the tracker if its label is TRAILER." + } + }, + "required": [ + "tracker_ignore_label.UNKNOWN", + "tracker_ignore_label.CAR", + "tracker_ignore_label.PEDESTRIAN", + "tracker_ignore_label.BICYCLE", + "tracker_ignore_label.MOTORCYCLE", + "tracker_ignore_label.BUS", + "tracker_ignore_label.TRUCK", + "tracker_ignore_label.TRAILER" + ] + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/detection_by_tracker" + } + }, + "required": ["ros__parameters"] + } + }, + "required": ["/**"] +}