run-scenario
यह क्या करती है
यह स्किल CARLA सिमुलेटर में तैयार ड्राइविंग टेस्ट परिदृश्यों में से एक शुरू करती है, और बताती है कि आपका CARLA संस्करण कौन-से परिदृश्य चला सकता है। यह उन लोगों के लिए है जो परखना चाहते हैं कि उनका सेल्फ़-ड्राइविंग सॉफ़्टवेयर तय स्थितियों को कैसे संभालता है।
कब इस्तेमाल करें
- ✓जब आप मानक टेस्ट चलाना चाहते हैं, जैसे कोई कार आगे चल रही गाड़ी के पीछे चले।
- ✓जब चुनने से पहले आपको देखना हो कि इंस्टॉल किया गया संस्करण कौन-से परिदृश्य सपोर्ट करता है।
- ✓जब आप चाहते हैं कि टेस्ट मुख्य कार का नियंत्रण ले या आपका प्रोग्राम उसे चलाए।
Skill का लिंक
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-scenario/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप CARLA में FollowLeadingVehicle टेस्ट चला सकते हैं, और मुझे दिखा सकते हैं कि मेरी कार पास हुई या नहीं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट कॉन्फ़िग नाम से परिदृश्य चुनता है, जाँचता है कि मैप मेल खाता है, फिर रन शुरू करता है। ज़रूरत पड़ने पर वह मैप दोबारा लोड कर सकता है, और टेस्ट खत्म होने पर नतीजा बताता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Run a scenario
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.
A "scenario" here is a Python class in srunner/scenarios/ plus an XML config in
srunner/examples/ that gives it a town, an ego spawn point and parameters. You
select it by the config name (FollowLeadingVehicle_1), not the class name.
Two things decide whether a run works, and both are silent when wrong:
- the branch — which scenarios and which towns exist at all,
- the map — a scenario declares its town, and ScenarioRunner refuses to run if the server is on a different one unless you let it reload.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: List what this checkout can run
- [ ] Step 3: Run it, with --reloadWorld unless the map already matches
- [ ] Step 4: Give the ego a driver (manual_control or an agent) if it needs one
- [ ] Step 5: Read the result; reset the world to async when done
Step 1-2: What can I run
source scripts/env.sh
bash scripts/check_env.sh
python3 scripts/list_scenarios.py # every config, its type and town
python3 scripts/list_scenarios.py --town Town04_Opt # only what fits the loaded map
python3 scripts/list_scenarios.py --check # configs whose type or town does not resolve
python3 scripts/list_scenarios.py --here # only what fits the *running* server's map
python3 scripts/list_scenarios.py --types # class -> configs, incl. route-only classes
list_scenarios.py parses the XML directly, so it works with no server and no
carla import — unlike scenario_runner.py --list, which constructs a client
first.
Step 3: Run
source scripts/env.sh
# the canonical smoke test
bash scripts/run_scenario.sh FollowLeadingVehicle_1
# every config of one class, in sequence
bash scripts/run_scenario.sh group:FollowLeadingVehicle
# deterministic: 20 Hz synchronous, results printed and written as JSON
SYNC=1 FRAME_RATE=20 OUTPUT=1 JSON=1 OUTPUT_DIR=./results \
bash scripts/run_scenario.sh ControlLoss_1
# repeat with randomised parameters, and record for later analysis
REPETITIONS=3 RANDOMIZE=1 RECORD=recordings bash scripts/run_scenario.sh DynamicObjectCrossing_1
Or call ScenarioRunner directly — the wrapper only adds the env, the map check and the async reset:
python3 "$SCENARIO_RUNNER_ROOT/scenario_runner.py" --scenario FollowLeadingVehicle_1 --reloadWorld
Knobs (all env vars on run_scenario.sh):
| Var | Effect |
|---|---|
RELOAD=0 |
do not reload the world (default reloads; needed when the map differs) |
SYNC=1 |
synchronous mode at FRAME_RATE Hz — required for reproducibility |
FRAME_RATE |
sync tick rate, default 20 |
OUTPUT=1 / FILE=1 / JSON=1 / JUNIT=1 |
result to stdout / .txt / .json / .xml |
OUTPUT_DIR |
where those files land |
REPETITIONS / RANDOMIZE=1 |
repeat count / randomise scenario parameters |
AGENT / AGENT_CONFIG |
drive the ego with an agent (route mode only — see below) |
RECORD=dir |
CARLA recorder log + a criteria JSON, relative to $SCENARIO_RUNNER_ROOT |
WAIT_FOR_EGO=1 |
attach to an ego someone else spawned instead of spawning one |
DEBUG=1 |
print the behaviour tree every tick |
TIMEOUT |
client timeout, default 120 s — an editor map switch needs it |
MAX_WALL |
wall-clock guard, default 1800 s; 0 disables. ScenarioRunner can print its verdict and never exit |
Step 4: Somebody has to drive
Most scenarios spawn the ego and then wait for it to move. Nothing drives it by itself. If you see
Preparing scenario: FollowLeadingVehicle_1
ScenarioManager: Running scenario FollowVehicle
No more scenarios .... Exiting
with nothing happening, that is the symptom. Options:
# keyboard control, in a second terminal
python3 "$SCENARIO_RUNNER_ROOT/manual_control.py"
# or hand the ego to the autopilot instead of driving it
python3 "$SCENARIO_RUNNER_ROOT/manual_control.py" -a
manual_control.py attaches to the vehicle whose role_name equals --rolename,
default hero, which is the ego role ScenarioRunner uses, so no flag is needed to
find the ego. -a/--autopilot only switches on the autopilot. It needs
pygame, which `requirement
अक्सर पूछे जाने वाले सवाल
परिदृश्य कभी-कभी शुरू क्यों नहीं होता?
आम तौर पर सिमुलेटर किसी ऐसे मैप पर होता है जो परिदृश्य को चाहिए नहीं, या परिदृश्य इस सॉफ़्टवेयर संस्करण में नहीं है।
क्या मैं रन रिकॉर्ड कर सकता हूँ?
हाँ। रन को सहेजा जा सकता है, ताकि आप उसे बाद में रीप्ले कर सकें।
क्या मुख्य कार को ड्राइवर चाहिए?
कुछ परिदृश्यों को चाहिए, इसलिए आप हाथ से कंट्रोल या स्वचालित एजेंट में से चुन सकते हैं।
जानकारी
लेखक का मूल विवरण
Runs a single ScenarioRunner Python scenario (or a whole group) against a running CARLA server — FollowLeadingVehicle, ControlLoss, DynamicObjectCrossing, SignalizedJunctionLeftTurn and the rest of srunner/examples — in sync or async mode, with result output, recording and manual/agent control of the ego. Lists what is runnable on the checked-out branch and on the loaded map. Use when the user asks to "run a scenario", "test FollowLeadingVehicle", "list scenarios", "run a CARLA traffic scenario", or reports a scenario that is "not supported".
repo: carla-simulator/carla
लोकप्रियता
- GitHub स्टार
- 15k
- रैंकिंग में स्थान
- #11112
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
create-leaderboard-route
15kयह आपके एजेंट को CARLA Leaderboard की रूट फ़ाइल बनाने में मदद करती है, जिसमें वेपॉइंट और सीन ट्रिगर कैमरे से लगाए जाते हैं।
package-leaderboard-agent
15kयह आपके एजेंट को CARLA Leaderboard के लिए Docker इमेज बनाने में मदद करती है, और जाँचती है कि इमेज में एजेंट सही लोड होता है।
read-leaderboard-results
15kयह आपके एजेंट को CARLA Leaderboard की नतीजा फ़ाइल पढ़कर हर रूट का स्कोर समझाने और दूसरे नियम संस्करण में फिर से स्कोर करने में मदद करती है।
run-leaderboard-evaluation
15kयह आपके एजेंट को रूट के सेट पर CARLA Leaderboard मूल्यांकन चलाने में मदद करती है, शुरू करने से पहले सेटअप जाँचकर और चेकपॉइंट सेव करके।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।