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::MetricArrayfor metric topics- Diagnostic topics passed from
.webauto-ci.ymlviaautoware.diagnostic_config
Inner-workings / Algorithms#
- For
tier4_metric_msgs::msg::MetricArray, The node subscribes to all topics listed in the parametermetric_topic_list. Each time such message is received, it is converted into as manyUserDefinedValuemessages as the number ofMetricobjects. The format of the output topic is detailed in the output section.
- For diagnostic topics from
autoware.diagnostic_config, The node subscribes to/diagnosticsEach time such message is received, it is converted into as manyUserDefinedValuemessages as the number ofDiagnosticStatusobjects in theDiagnosticArray. The format of the inputautoware.diagnostic_configis detailed in the input section. The format of the output topic is detailed in the output section.
Metric Array Inputs / Outputs#
Metric Array Inputs#
The node listens to MetricArray messages on the topics specified in metric_topic_list.
Metric Array Outputs#
The node outputs UserDefinedValue messages that are converted from the received 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/metricsand receive aMetricArraywith 2 metrics:- metric with
name: "metricA/x" - metric with
name: "metricA/y"
- metric with
- The resulting topics to publish the
UserDefinedValueare as follows:/planning/planning_evaluator/metrics/metricA/x/planning/planning_evaluator/metrics/metricA/y
Diagnostics Inputs / Outputs#
Diagnostics extracts the level field from DiagnosticStatus and outputs it as a single value to correspond with tier4_simulation_msgs::msg::UserDefinedValue messages.
Diagnostics Inputs#
- The node listens to
/diagnostics. MultipleDiagnosticStatusobjects are extracted from theDiagnosticArraywithin/diagnostics.
- About
autoware.diagnostic_config:- The configuration file is specified from
.webauto-ci.yml. - Under
diagnostic_groups, create a group name and defineoutput_topic_nameandaggregation_listunder it.output_topic_name- Specifies the topic name to publish to.
- The format
/diagnostics/scenario_simulator_v2_adapter/***is recommended.
aggregation_list- Lists the diagnostic topics to be grouped.
- Can include
output_topic_namedeclared in the same format (recursively expanded).
- A sample configuration can be found in
autoware_scenario_simulator_v2_adapter/config/diagnostic_config.param.yaml.
- The configuration file is specified from
/**:
ros__parameters:
diagnostic_groups:
overall_diagnostics:
output_topic_name: /diagnostics/scenario_simulator_v2_adapter/overall_diagnostics
aggregation_list:
- /diagnostics/scenario_simulator_v2_adapter/topic_state_monitor_diagnostics
topic_state_monitor_diagnostics:
output_topic_name: /diagnostics/scenario_simulator_v2_adapter/topic_state_monitor_diagnostics
aggregation_list:
- /diagnostics/topic_state_monitor_mission_planning_route/planning_topic_status
- /diagnostics/topic_state_monitor_scenario_planning_trajectory/planning_topic_status
Diagnostics Outputs#
The node outputs UserDefinedValue messages that are converted from the received messages.
Diagnostics output has two patterns:
- One-to-one correspondence with diagnostic status names.
- Grouped output based on
autoware.diagnostic_configthat aggregates diagnostic status names.
- For individual publish:
The name of the output topics are generated from
/diagnostics/prefix and thestatus.namefield of eachDiagnosticStatus. The": "in the status name is replaced with/to form a valid topic name.- status name:
planning_validator: intersection_validation_collision_check - publish topic name:
/diagnostics/planning_validator/intersection_validation_collision_check
- status name:
- For grouped topic publish:
The name of the output topics is used
output_topic_nameinautoware.diagnostic_config. Each time aDiagnosticStatusthat matches any topic in theaggregation_listis received, its level value is published to theoutput_topic_nametopic. If the level isERROR, a warning is logged with the diagnostic topic name and group name.
Parameters#
| Name | Type | Description | Default | Range |
|---|---|---|---|---|
| metric_topic_list | array | The topic name list of the processing time. | [] | N/A |
Assumptions / Known limits#
Values in the Metric objects of a MetricArray are assumed to be of type double.