From c3a09f26b7b8960002ce58e3f1ea4bb7826d8e4e Mon Sep 17 00:00:00 2001 From: oguzkaganozt Date: Thu, 4 Apr 2024 13:39:22 +0300 Subject: [PATCH] add param and schema file Signed-off-by: oguzkaganozt --- sensing/livox/livox_tag_filter/CMakeLists.txt | 1 + .../config/livox_tag_filter.param.yaml | 19 ++++++++++ .../launch/livox_tag_filter.launch.xml | 23 ++---------- .../schema/livox_tag_filter.schema.json | 36 +++++++++++++++++++ .../livox_tag_filter_node.cpp | 2 +- 5 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 sensing/livox/livox_tag_filter/config/livox_tag_filter.param.yaml create mode 100644 sensing/livox/livox_tag_filter/schema/livox_tag_filter.schema.json diff --git a/sensing/livox/livox_tag_filter/CMakeLists.txt b/sensing/livox/livox_tag_filter/CMakeLists.txt index 90b5eeed713c0..36c500aefa74d 100644 --- a/sensing/livox/livox_tag_filter/CMakeLists.txt +++ b/sensing/livox/livox_tag_filter/CMakeLists.txt @@ -21,4 +21,5 @@ rclcpp_components_register_node(livox_tag_filter ament_auto_package(INSTALL_TO_SHARE launch + config ) diff --git a/sensing/livox/livox_tag_filter/config/livox_tag_filter.param.yaml b/sensing/livox/livox_tag_filter/config/livox_tag_filter.param.yaml new file mode 100644 index 0000000000000..5772c107010c2 --- /dev/null +++ b/sensing/livox/livox_tag_filter/config/livox_tag_filter.param.yaml @@ -0,0 +1,19 @@ +/**: + ros__parameters: + ignore_tags: [] + # bit 0~1: Point property based on spatial position + # 00: Normal + # 01: High confidence level of the noise + # 10: Moderate confidence level of the noise + # 11: Low confidence level of the noise + # bit 2~3: Point property based on intensity + # 00: Normal + # 01: High confidence level of the noise + # 10: Moderate confidence level of the noise + # 11: Reserved + # bit 4~5: Return number + # 00: return 0 + # 01: return 1 + # 10: return 2 + # 11: return 3 + # bit 6~7: Reserved \ No newline at end of file diff --git a/sensing/livox/livox_tag_filter/launch/livox_tag_filter.launch.xml b/sensing/livox/livox_tag_filter/launch/livox_tag_filter.launch.xml index 1da6c3074e7e7..331db891358f7 100644 --- a/sensing/livox/livox_tag_filter/launch/livox_tag_filter.launch.xml +++ b/sensing/livox/livox_tag_filter/launch/livox_tag_filter.launch.xml @@ -1,30 +1,11 @@ - - - + - + diff --git a/sensing/livox/livox_tag_filter/schema/livox_tag_filter.schema.json b/sensing/livox/livox_tag_filter/schema/livox_tag_filter.schema.json new file mode 100644 index 0000000000000..c9c3dbabd48d6 --- /dev/null +++ b/sensing/livox/livox_tag_filter/schema/livox_tag_filter.schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Livox Tag Filter Parameters", + "type": "object", + "definitions": { + "livox_tag_filter": { + "type": "object", + "properties": { + "ignore_tags": { + "type": "array", + "description": "ignored tags (int array) (See the table in the readme file)", + "default": "[]" + } + }, + "required": [ + "ignore_tags" + ], + "additionalProperties": false + } + }, + "properties": { + "/**": { + "type": "object", + "properties": { + "ros__parameters": { + "$ref": "#/definitions/livox_tag_filter" + } + }, + "required": ["ros__parameters"], + "additionalProperties": false + } + }, + "required": ["/**"], + "additionalProperties": false + } + \ No newline at end of file diff --git a/sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp b/sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp index 2fd55ce8df6a0..f3216fdcd9b6a 100644 --- a/sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp +++ b/sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp @@ -40,7 +40,7 @@ LivoxTagFilterNode::LivoxTagFilterNode(const rclcpp::NodeOptions & node_options) : Node("livox_tag_filter", node_options) { // Parameter - ignore_tags_ = this->declare_parameter("ignore_tags", std::vector{}); + ignore_tags_ = this->declare_parameter>("ignore_tags"); // Subscriber using std::placeholders::_1;