Skip to content

Commit

Permalink
add param and schema file
Browse files Browse the repository at this point in the history
Signed-off-by: oguzkaganozt <[email protected]>
  • Loading branch information
oguzkaganozt committed Apr 4, 2024
1 parent 41aab51 commit c3a09f2
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 22 deletions.
1 change: 1 addition & 0 deletions sensing/livox/livox_tag_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ rclcpp_components_register_node(livox_tag_filter

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
19 changes: 19 additions & 0 deletions sensing/livox/livox_tag_filter/config/livox_tag_filter.param.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 2 additions & 21 deletions sensing/livox/livox_tag_filter/launch/livox_tag_filter.launch.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
<launch>
<arg name="input" description="input topic name"/>
<arg name="output" description="output topic name"/>

<!--
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
-->
<arg name="ignore_tags" description="tags to be ignored(see comments in livox_tag_filter.launch.xml for more details)"/>
<arg name="param_file" default="$(find-pkg-share livox_tag_filter)/config/livox_tag_filter.param.yaml"/>

<node pkg="livox_tag_filter" exec="livox_tag_filter_node" name="livox_tag_filter_node" output="screen">
<remap from="input" to="$(var input)"/>
<remap from="output" to="$(var output)"/>
<param name="ignore_tags" value="$(var ignore_tags)"/>
<param from="$(var param_file)"/>
</node>
</launch>
36 changes: 36 additions & 0 deletions sensing/livox/livox_tag_filter/schema/livox_tag_filter.schema.json
Original file line number Diff line number Diff line change
@@ -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
}

Original file line number Diff line number Diff line change
Expand Up @@ -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<std::int64_t>{});
ignore_tags_ = this->declare_parameter<std::vector<std::int64_t>>("ignore_tags");

Check warning on line 43 in sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp

View check run for this annotation

Codecov / codecov/patch

sensing/livox/livox_tag_filter/src/livox_tag_filter_node/livox_tag_filter_node.cpp#L43

Added line #L43 was not covered by tests

// Subscriber
using std::placeholders::_1;
Expand Down

0 comments on commit c3a09f2

Please sign in to comment.