Skip to content

Commit

Permalink
refactor(sensing/livox_tag_filter): rework parameters (#6743)
Browse files Browse the repository at this point in the history
* add param and schema file

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

* style(pre-commit): autofix

---------

Signed-off-by: oguzkaganozt <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kenzo Lobos Tsunekawa <[email protected]>
  • Loading branch information
3 people authored Apr 26, 2024
1 parent 553ac9a commit 1872e9b
Show file tree
Hide file tree
Showing 5 changed files with 56 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>
33 changes: 33 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,33 @@
{
"$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");

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

0 comments on commit 1872e9b

Please sign in to comment.