Skip to content

Commit

Permalink
rewrite diagnostic_convertor to scenario_simulator_v2_adapter, suppor…
Browse files Browse the repository at this point in the history
…ting metric_msgs.
  • Loading branch information
xtk8532704 committed Oct 29, 2024
1 parent 978e089 commit 816fc75
Show file tree
Hide file tree
Showing 13 changed files with 322 additions and 313 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ control/predicted_path_checker/** [email protected]
evaluator/autoware_control_evaluator/** [email protected] [email protected] [email protected] [email protected]
evaluator/autoware_evaluator_utils/** [email protected] [email protected]
evaluator/autoware_planning_evaluator/** [email protected] [email protected]
evaluator/diagnostic_converter/** [email protected] [email protected] [email protected]
evaluator/scenario_simulator_v2_adapter/** [email protected] [email protected] [email protected]
evaluator/kinematic_evaluator/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
evaluator/localization_evaluator/** [email protected] [email protected]
evaluator/perception_online_evaluator/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
53 changes: 0 additions & 53 deletions evaluator/diagnostic_converter/README.md

This file was deleted.

101 changes: 0 additions & 101 deletions evaluator/diagnostic_converter/src/converter_node.cpp

This file was deleted.

128 changes: 0 additions & 128 deletions evaluator/diagnostic_converter/test/test_converter_node.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 default CMake version

project(diagnostic_converter)
project(scenario_simulator_v2_adapter)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
Expand All @@ -21,7 +21,7 @@ ament_auto_add_library(${PROJECT_NAME}_node SHARED
)

rclcpp_components_register_node(${PROJECT_NAME}_node
PLUGIN "diagnostic_converter::DiagnosticConverter"
PLUGIN "scenario_simulator_v2_adapter::MetricConverter"
EXECUTABLE ${PROJECT_NAME}
)

Expand Down
42 changes: 42 additions & 0 deletions evaluator/scenario_simulator_v2_adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# scenario_simulator_v2 Adapter

## Purpose

This package provides a node to convert various messages from the Autoware into `tier4_simulation_msgs::msg::UserDefinedValue` messages for the scenario_simulator_v2.
Currently, this node supports conversion of:
- `tier4_metric_msgs::msg::MetricArray` for metric topics

## Inner-workings / Algorithms

- For `tier4_metric_msgs::msg::MetricArray`,
The node subscribes to all topics listed in the parameter `metric_topic_list`.
Each time such message is received, it is converted into as many `UserDefinedValue` messages as the number of `Metric` objects.
The format of the output topic is detailed in the _output_ section.

## Inputs / Outputs

### Inputs

The node listens to `MetricArray` messages on the topics specified in `metric_topic_list`.

### Outputs

The node outputs `UserDefinedValue` messages that are converted from the received messages.

- For `MetricArray` messages,
The name of the output topics are generated from the corresponding input topic, the name of the metric.
- For example, we might listen to topic `/planning/planning_evaluator/metrics` and receive a `MetricArray` with 2 metrics:
- metric with `name: "metricA/x"`
- metric with `name: "metricA/y"`
- The resulting topics to publish the `UserDefinedValue` are as follows:
- `/planning/planning_evaluator/metrics/metricA/x`
- `/planning/planning_evaluator/metrics/metricA/y`

## Parameters
{{ json_to_markdown("src/autoware/universe/evaluator/scenario_simulator_v2_adapter/schema/scenario_simulator_v2_adapter.schema.json") }}

## Assumptions / Known limitsmetrics_x

Check warning on line 38 in evaluator/scenario_simulator_v2_adapter/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (limitsmetrics)

Values in the `Metric` objects of a `MetricArray` are assumed to be of type `double`.

## Future extensions / Unimplemented parts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**:
ros__parameters:
update_rate: 10.0
metric_topic_list:
- /planning/planning_evaluator/metrics
- /control/control_evaluator/metrics
- /system/processing_time_checker/metrics
Loading

0 comments on commit 816fc75

Please sign in to comment.