본문으로 건너뛰기
cccskills
무료GitHub에 공개

analyze-scenario-results

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md8.0 KB
  • references/metrics.md6.2 KB
  • scripts/analyze_results.py11.4 KB
  • scripts/check_env.sh6.4 KB
  • scripts/env.sh5.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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:

ArtefactProduced byAnswers
criteria table--output / --file / --json / --junitdid it pass, and which criterion failed
criteria JSON next to a recording--recordthe full criterion state, for tooling
CARLA recorder log--recordeverything 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:

MetricWhat it shows
basic_metric.pythe minimum: subclass BasicMetric, implement _create_metric
criteria_filter.pypull specific fields out of the criteria JSON into a table
distance_between_vehicles.pyper-frame distance between two actors, plotted
distance_to_lane_center.pylateral 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 failedRead as
CollisionTestthe ego hit something — check the recording for what
DrivenDistanceTestthe ego did not get far enough: blocked, or the scenario ended early
ActorBlockedTestthe ego stopped and stayed stopped
KeepLaneTest / WrongLaneTest / OnSidewalkTestlateral control or a bad overtake
RunningRedLightTest / RunningStopTesttraffic-control handling
RouteCompletionTest < 100route not finished (route mode)
InRouteTestthe ego left the route corridor — usually a wrong turn
ScenarioTimeoutTesta scenario did not finish in its own budget

"All scenario tests were passed successfully!" on stdout means every criterion passed. "Not all scenario tests were successful" with no table means you forgot --output.

Examples

Example 1: "did my controller pass the control-loss scenarios?"

Run group:ControlLoss with OUTPUT=1 JSON=1 OUTPUT_DIR=./results, then summary ./results. 15 configs, one line each, failures named.

Example 2: "why did FollowLeadingVehicle_1 fail?"

summary says CollisionTest. Re-run with RECORD=recordings, then replay it ([[replay-recording]]) to watch the impact, and run distance_between_vehicles.py to see the gap closing rate.

Example 3: "compare before and after my change"

Two OUTPUT_DIRs, then compare ./before ./after. It reports criteria that flipped in either direction, so a fix that broke something else is visible.

Troubleshooting

Problem: "Not all scenario tests were successful" with no detail Cause: no output flag. Solution: add OUTPUT=1 (stdout) and/or JSON=1.

Problem: no result files in OUTPUT_DIR Cause: --outputDir only takes effect with one of --file/--json/--junit; --output alone prints to stdout. Solution: set JSON=1 as well.

Problem: metrics_manager.py fails with a connection error Cause: it needs a live server to replay against. Solution: start one ([[run-carla-server]]); the map does not matter, the recording names its own.

Problem: the metric runs but every transform is None Cause: actor ids in the recording do not match what the metric asks for, usually because it hard-codes ids from a different run. Solution: resolve ids through MetricsLog.get_ego_vehicle_id() and get_actor_ids_with_role_name() rather than by number.

Problem: --criteria file not found next to the recording Cause: the criteria JSON is written by _record_criteria only when --record was used, and its name is the recording name with .log replaced by .json. Solution: re-run with RECORD=; without it there is no criteria file to pass.

Problem: replaying a recording made by a different CARLA version does nothing Cause: recorder logs are version-specific. Solution: replay with the version that recorded it.

Outputs

A per-scenario pass/fail summary, a criterion-level diff between two runs, or a metric's table/plot over a recording. Nothing is modified: all three modes are read-only over files, plus a replay on the server for metrics.

The metrics API — BasicMetric, MetricsLog, and what the recorder actually stores — is in references/metrics.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Adds a new ROS 2 message type to CARLA's native ROS 2 interface — the hand-written POD struct under LibCarla/source/carla/ros2/types/msg, its Fast-CDR serialize/deserialize pair, the RIHS01 type hash computed in Docker, the CdrTopicInfo registration and the type-hash test. Use when the user asks to "add a ROS message type", "support sensor_msgs/X in CARLA", "add a carla_msgs type", "why is my type hash warning appearing", or needs a message CARLA does not publish yet. There is no IDL codegen — every step is manual.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

Adds a new topic to CARLA's native ROS 2 interface — a publisher (BasePublisher + PublisherImpl, topic suffix, QoS, registration in ROS2::GetOrCreateSensor, a ProcessDataFrom* entry point and its call site in the UE4 plugin) or a subscriber that lets ROS drive an actor. Also covers adding a middleware (RMW) behind IPublisherMiddleware. Use when the user asks to "publish X to ROS from CARLA", "add a ROS topic/publisher/subscriber", "make the obstacle/lane-invasion sensor publish", "add odometry to ROS", or "add another RMW".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

Gets actor and level 3D bounding boxes and projects them into a camera image as 2D boxes — the dataset-annotation workflow. Lists box geometry, draws 3D boxes in the world via debug, or captures one camera frame and writes an annotated PNG plus a JSON of 2D boxes for matching actors. Use when the user asks to "get bounding boxes", "draw boxes around the cars", "project boxes onto the camera", or "generate a detection dataset / annotations".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

Builds CARLA (branch ue4-dev, Unreal Engine 4.26) from source on Linux end-to-end — UE4 fork, the Carla server (editor C++ modules), the LibCarla Python client wheel, and content — then verifies them against a from-source server. Optionally builds the native ROS 2 interface in (ROS2=1 → --ros2, Fast-DDS/CycloneDDS/Zenoh), which is compile-time only and cannot be enabled later. Use when the user asks to "build CARLA from source", "compile CARLA ue4-dev", "set up CARLA on Ubuntu (incl. 24.04)", "build CARLA with ROS2 support", or "produce a CARLA server + client wheel". Cooking a distributable Dist/ package is a separate skill (package-carla-ue4); running the build is run-carla-server.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

Builds CARLA on Unreal Engine 5.8 from the ue58-dev branch using its CMake build system — configure a preset, then build the carla-unreal / carla-unreal-editor / carla-python-api-install / launch targets — with ROS 2, DLSS, RSS and cook-scope options, and the engine-side build of the CarlaUnreal UE 5.8 fork. There is no Makefile and no Util/BuildTools in this tree, so every UE4 `make` recipe is invalid here. Use when the user asks to "build CARLA UE5", "build ue58-dev", "compile CARLA with cmake", "rebuild the Python API", or hits a CMake configure or target failure.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

Create, migrate, improve, or debug detailed vehicle assets for CARLA using Blender and Unreal, including reference-based geometry, materials, wheels, physics, lights, and runtime validation. Use for vehicle asset authoring rather than ordinary traffic spawning or map decoration.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

carla-simulator/carla-agentic-tools42026년 9월 12일 업데이트

carla-simulator의 스킬 모두 보기

이 스킬의 문제 신고