Skip to content

Commit 1872e9b

Browse files
oguzkaganoztpre-commit-ci[bot]knzo25
authored
refactor(sensing/livox_tag_filter): rework parameters (#6743)
* add param and schema file Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com> * style(pre-commit): autofix --------- Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kenzo Lobos Tsunekawa <kenzo.lobos@tier4.jp>
1 parent 553ac9a commit 1872e9b

File tree

5 files changed

+56
-22
lines changed

5 files changed

+56
-22
lines changed

sensing/livox/livox_tag_filter/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ rclcpp_components_register_node(livox_tag_filter
2121

2222
ament_auto_package(INSTALL_TO_SHARE
2323
launch
24+
config
2425
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**:
2+
ros__parameters:
3+
ignore_tags: []
4+
# bit 0~1: Point property based on spatial position
5+
# 00: Normal
6+
# 01: High confidence level of the noise
7+
# 10: Moderate confidence level of the noise
8+
# 11: Low confidence level of the noise
9+
# bit 2~3: Point property based on intensity
10+
# 00: Normal
11+
# 01: High confidence level of the noise
12+
# 10: Moderate confidence level of the noise
13+
# 11: Reserved
14+
# bit 4~5: Return number
15+
# 00: return 0
16+
# 01: return 1
17+
# 10: return 2
18+
# 11: return 3
19+
# bit 6~7: Reserved
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
<launch>
22
<arg name="input" description="input topic name"/>
33
<arg name="output" description="output topic name"/>
4-
5-
<!--
6-
bit 0~1: Point property based on spatial position
7-
00: Normal
8-
01: High confidence level of the noise
9-
10: Moderate confidence level of the noise
10-
11: Low confidence level of the noise
11-
bit 2~3: Point property based on intensity
12-
00: Normal
13-
01: High confidence level of the noise
14-
10: Moderate confidence level of the noise
15-
11: Reserved
16-
bit 4~5: Return number
17-
00: return 0
18-
01: return 1
19-
10: return 2
20-
11: return 3
21-
bit 6~7: Reserved
22-
-->
23-
<arg name="ignore_tags" description="tags to be ignored(see comments in livox_tag_filter.launch.xml for more details)"/>
4+
<arg name="param_file" default="$(find-pkg-share livox_tag_filter)/config/livox_tag_filter.param.yaml"/>
245

256
<node pkg="livox_tag_filter" exec="livox_tag_filter_node" name="livox_tag_filter_node" output="screen">
267
<remap from="input" to="$(var input)"/>
278
<remap from="output" to="$(var output)"/>
28-
<param name="ignore_tags" value="$(var ignore_tags)"/>
9+
<param from="$(var param_file)"/>
2910
</node>
3011
</launch>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Livox Tag Filter Parameters",
4+
"type": "object",
5+
"definitions": {
6+
"livox_tag_filter": {
7+
"type": "object",
8+
"properties": {
9+
"ignore_tags": {
10+
"type": "array",
11+
"description": "ignored tags (int array) (See the table in the readme file)",
12+
"default": "[]"
13+
}
14+
},
15+
"required": ["ignore_tags"],
16+
"additionalProperties": false
17+
}
18+
},
19+
"properties": {
20+
"/**": {
21+
"type": "object",
22+
"properties": {
23+
"ros__parameters": {
24+
"$ref": "#/definitions/livox_tag_filter"
25+
}
26+
},
27+
"required": ["ros__parameters"],
28+
"additionalProperties": false
29+
}
30+
},
31+
"required": ["/**"],
32+
"additionalProperties": false
33+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LivoxTagFilterNode::LivoxTagFilterNode(const rclcpp::NodeOptions & node_options)
4040
: Node("livox_tag_filter", node_options)
4141
{
4242
// Parameter
43-
ignore_tags_ = this->declare_parameter("ignore_tags", std::vector<std::int64_t>{});
43+
ignore_tags_ = this->declare_parameter<std::vector<std::int64_t>>("ignore_tags");
4444

4545
// Subscriber
4646
using std::placeholders::_1;

0 commit comments

Comments
 (0)