analyze-scenario-results
Skill này làm gì
Skill đọc các file kết quả từ một lần chạy kiểm thử lái xe và biến chúng thành bản tóm tắt dễ hiểu. Skill dành cho người cần biết một bài kiểm thử đã đạt hay chưa và điều gì đã sai.
Khi nào nên dùng
- ✓Khi bạn muốn biết một bài kiểm thử lái xe đạt hay thất bại.
- ✓Khi bạn cần hiểu kiểm tra cụ thể nào gây ra lỗi.
- ✓Khi bạn muốn so sánh hai lần chạy để xem điều gì đã thay đổi.
Liên kết skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/analyze-scenario-results/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bài kiểm thử lái xe CARLA của tôi có đạt không, và nếu không, kiểm tra nào thất bại và vì sao?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent mở các file kết quả đã lưu, liệt kê từng kiểm tra cùng trạng thái đạt hoặc không đạt, và có thể so sánh hai lần chạy cạnh nhau. Nó cũng có thể đo thêm các số liệu từ một bản ghi đã lưu mà không cần chạy simulator.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Analyse scenario results
Paths.
scripts/…andreferences/…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 |
Câu hỏi thường gặp
Nó có cần simulator đang chạy không?
Không. Skill đọc kết quả và bản ghi đã lưu, nên không cần simulator.
Nó đọc được những file nào?
Bảng kết quả, file kết quả JSON và JUnit, và các file tiêu chí lưu cùng bản ghi.
Nó có đo được những thứ không được ghi lại không?
Không. Các số đo thêm chỉ hoạt động trên một bản ghi được lưu trong lúc chạy.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11108
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-leaderboard-route
15kGiúp agent của bạn tạo file tuyến đường CARLA Leaderboard bằng cách đặt các điểm waypoint và trigger kịch bản từ camera của simulator, rồi kiểm tra và sắp xếp chúng.
package-leaderboard-agent
15kGiúp agent của bạn đóng gói một agent lái xe thành image Docker để nộp lên CARLA Leaderboard, kiểm tra cấu trúc thư mục và thử rằng image nạp được agent.
read-leaderboard-results
15kGiúp agent của bạn đọc file kết quả CARLA Leaderboard, giải thích điểm và vi phạm của từng tuyến, và chấm lại một lần chạy theo phiên bản luật khác.
run-leaderboard-evaluation
15kGiúp agent của bạn chạy bộ đánh giá CARLA Leaderboard trên một tập tuyến với agent lái xe, kiểm tra thiết lập trước và lưu checkpoint để có thể tiếp tục.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.