本文へスキップ
Skillpedia
分析とスプレッドシート15k · #11108

analyze-scenario-results

できること

このスキルは、テスト実行の結果ファイルを読み、平易な要約に変えます。テストに合格したかどうか、何が問題だったかを知る必要がある人向けです。

使う場面

  • ✓運転テストに合格したか、失敗したかを知りたいとき。
  • ✓どの具体的なチェックが失敗の原因かを理解したいとき。
  • ✓2つのテスト実行を比べ、何が変わったかを見たいとき。

スキルのリンク

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/analyze-scenario-results/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/analyze-scenario-results/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のCARLA運転テストは合格しましたか?失敗していた場合、どのチェックが、なぜ失敗したのか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは保存された結果ファイルを開き、各チェックの合否の状態を一覧にします。また、二つの実行を並べて比べることもできます。保存された記録から追加の数値を計算することもできますが、シミュレーターは実行しません。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Analyse scenario results

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

Three separate things get called "results", and they answer different questions:

Artefact Produced by Answers
criteria table --output / --file / --json / --junit did it pass, and which criterion failed
criteria JSON next to a recording --record the full criterion state, for tooling
CARLA recorder log --record everything that happened, replayable

The metrics module works off the third one, so anything you did not --record can only be re-measured by re-running.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh)
- [ ] Step 2: Summarise the result files you have
- [ ] Step 3: For deeper analysis, run a metric over a recording
- [ ] Step 4: Compare runs if you have more than one

Step 2: Summarise

source scripts/env.sh

python3 scripts/analyze_results.py summary ./results            # a directory of results
python3 scripts/analyze_results.py summary ./results/*.json     # specific files
python3 scripts/analyze_results.py compare ./before ./after      # two runs, criterion by criterion

summary reads .json, .xml (junit) and .txt outputs, normalises them, and prints one line per scenario with the failing criteria named. compare diffs two sets by scenario name and criterion, which is the useful view when you changed a controller and want to know what got worse.

To produce these in the first place, run with the output flags:

cd ../run-scenario
OUTPUT=1 JSON=1 OUTPUT_DIR=./results bash scripts/run_scenario.sh group:ControlLoss

Note the file naming: ScenarioRunner writes <outputDir>/<config name><YYYY-MM-DD-HH-MM-SS>.json with no separator before the timestamp, so names look like ControlLoss_12025-08-14-10-22-31.json. analyze_results.py splits that back apart.

Step 3: Metrics over a recording

Record first — this writes both a .log recording and a <name>.json of criteria:

cd ../run-scenario
RECORD=recordings bash scripts/run_scenario.sh FollowLeadingVehicle_1
# -> $SCENARIO_RUNNER_ROOT/recordings/FollowLeadingVehicle_1.log
#    $SCENARIO_RUNNER_ROOT/recordings/FollowLeadingVehicle_1.json

Then run a metric:

source scripts/env.sh

python3 scripts/analyze_results.py metrics --list      # bundled example metrics

python3 scripts/analyze_results.py metrics \
    --metric "$SCENARIO_RUNNER_ROOT/srunner/metrics/examples/distance_between_vehicles.py" \
    --log recordings/FollowLeadingVehicle_1.log \
    --criteria recordings/FollowLeadingVehicle_1.json

which is a wrapper for

python3 "$SCENARIO_RUNNER_ROOT/metrics_manager.py" \
    --metric <metric.py> --log <recording.log> [--criteria <criteria.json>]

The metrics module needs a running server even though it computes offline: it replays the recording to recover the map and to resolve actor ids to positions. That is the one non-obvious prerequisite.

Bundled examples, in increasing complexity:

Metric What it shows
basic_metric.py the minimum: subclass BasicMetric, implement _create_metric
criteria_filter.py pull specific fields out of the criteria JSON into a table
distance_between_vehicles.py per-frame distance between two actors, plotted
distance_to_lane_center.py lateral error against the lane centre, plotted

Writing your own is a subclass of BasicMetric with one method; the recording is exposed as a MetricsLog object with get_actor_transforms, get_ego_vehicle_id, get_all_frames and friends. Details in references/metrics.md.

Step 4: What the criteria mean

A failing criterion names the behaviour that broke, not the cause:

Criterion failed Read as
CollisionTest the ego hit something — check the recording for what
DrivenDistanceTest the ego did not get far enough: blocked, or the scenario ended early
ActorBlockedTest the ego stopped and stayed stopped
KeepLaneTest / WrongLaneTest / OnSidewalkTest lateral control or a bad overtake
RunningRedLightTest / RunningStopTest traffic-control handling
RouteCompletionTest < 100 route not finished (route mode
よくある質問

シミュレーターが実行されている必要がありますか?

いいえ。保存された結果と記録を読むので、シミュレーターは不要です。

どのファイルを読めますか?

結果の表、JSONとJUnitの結果ファイル、そして記録と一緒に保存された基準ファイルです。

記録されていない値も計測できますか?

いいえ。追加の計測は、実行中に保存された記録に対してのみ行えます。

詳細

作者による元の説明

Reads and summarises ScenarioRunner output — the criteria pass/fail tables from --output/--file, the machine-readable --json and --junit result files, and the criteria JSON written alongside a --record recording — and runs the metrics module (metrics_manager.py) to compute custom measurements over a recorded run offline, without the simulator. Use when the user asks "did the scenario pass", "why did it fail", "summarise these results", "compare these runs", or wants distance/speed/lane metrics from a recording.

repo: carla-simulator/carla

人気

GitHubのスター
15k
ランキング
#11108
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル