Skip to content

Commit

Permalink
refactor(evaluator/localization_evaluator): rework parameters (autowa…
Browse files Browse the repository at this point in the history
…refoundation#6744)

* add param file and schema

Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>

* style(pre-commit): autofix

* .

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>

* .

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>

* .

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>

---------

Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>
Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
oguzkaganozt and pre-commit-ci[bot] authored Sep 4, 2024
1 parent 223d06a commit 1ae6082
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 4 deletions.
2 changes: 1 addition & 1 deletion evaluator/localization_evaluator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ endif()

ament_auto_package(
INSTALL_TO_SHARE
param
config
launch
)
6 changes: 5 additions & 1 deletion evaluator/localization_evaluator/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Localization Evaluator

TBD
The Localization Evaluator evaluates the performance of the localization system and provides metrics

## Parameters

{{ json_to_markdown("evaluator/localization_evaluator/schema/localization_evaluator.schema.json") }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="input/localization/ref" default="/geometry_msgs/PoseWithCovarianceStampedGt"/>

<node name="localization_evaluator" exec="localization_evaluator" pkg="localization_evaluator" output="screen">
<param from="$(find-pkg-share localization_evaluator)/param/localization_evaluator.defaults.yaml"/>
<param from="$(find-pkg-share localization_evaluator)/config/localization_evaluator.param.yaml"/>
<remap from="~/input/localization" to="$(var input/localization)"/>
<remap from="~/input/localization/ref" to="$(var input/localization/ref)"/>
</node>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Localization Evaluator",
"type": "object",
"definitions": {
"localization_evaluator": {
"type": "object",
"properties": {
"output_file": {
"type": "string",
"default": "loc_metrics.results",
"description": "if empty, metrics are not written to file"
},
"selected_metrics": {
"type": "array",
"default": "['lateral_error', 'absolute_error']",
"description": "metrics to be calculated"
}
},
"required": ["output_file", "selected_metrics"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/localization_evaluator"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class EvalTest : public ::testing::Test
rclcpp::NodeOptions options;
const auto share_dir = ament_index_cpp::get_package_share_directory("localization_evaluator");
options.arguments(
{"--ros-args", "--params-file", share_dir + "/param/localization_evaluator.defaults.yaml"});
{"--ros-args", "--params-file", share_dir + "/config/localization_evaluator.param.yaml"});

dummy_node = std::make_shared<rclcpp::Node>("localization_evaluator_test_node");
eval_node = std::make_shared<EvalNode>(options);
Expand Down

0 comments on commit 1ae6082

Please sign in to comment.