Chuyển đến nội dung
Skillpedia
Kiểm thử15k · #11113

create-scenic-scenario

Skill này làm gì

Skill biến mô tả bằng ngôn ngữ thường về một tình huống giao thông thành file Scenic cho simulator CARLA. Skill dành cho người viết các bài kiểm thử giao thông lặp lại được mà không cần đặt từng xe và người bằng tay.

Khi nào nên dùng

  • ✓Khi bạn muốn mô tả một tình huống giao thông bằng lời và nhận một file kiểm thử cho nó.
  • ✓Khi bạn cần một kịch bản trong đó một xe cắt vào từ bên hông hoặc một người băng qua đường.
  • ✓Khi bạn muốn file được kiểm tra để chắc chắn nó hoạt động trước khi chạy trên simulator.

Liên kết skill

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenic/create-scenic-scenario/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenic/create-scenic-scenario/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể viết một kịch bản Scenic trong đó một xe cắt vào từ làn phải ngay trước xe của tôi, rồi kiểm tra xem nó có hoạt động không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent biến mô tả của bạn thành một kế hoạch ngắn, rồi tạo file bằng các mẫu đã biết là hoạt động với bản build này. Sau đó nó biên dịch file và lấy mẫu các cảnh để xác nhận nó chạy được, mà không khởi động 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.

Create a Scenic scenario from a description

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.

Scenic describes a distribution over scenes, not one scene. So a good scenario is not a script of positions — it is a set of constraints loose enough to sample and tight enough to be the situation asked for.

Translating a request has three parts, and only the first is a judgement call:

  1. request → spec (yours): pick the map, the placement, the actors and their relations.
  2. spec → file (scripts/scaffold_scenic.py): emits boilerplate and placement idioms lifted from scenarios that run on this build.
  3. validate (same script): compile, then sample. No server needed.

Do not hand-write the boilerplate. Three things bite every time and the generator already handles them:

  • assert len(x) > 0 is illegal on a random value. Anything derived from a Uniform(...) raises RandomControlFlowError. Only assert on lists built deterministically from network.
  • Pedestrians and props need with regionContainedIn None when placed on the road. Containment is re-checked every sample, so without it generation never converges — it looks like an unsatisfiable require.
  • param map and param carla_map must name the same town. map builds the road network; carla_map tells CARLA what to load. Disagree and the scene is sampled on one map and simulated on another.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh)
- [ ] Step 2: Pick a map that can express the situation
- [ ] Step 3: Pick blueprints that exist in THIS build
- [ ] Step 4: Write the spec, generate, and let it validate
- [ ] Step 5: Loop on the verdict until it samples; then simulate

Step 2: The map has to support the situation

A scenario selects road features. If the map has none of them, no wording will save it — the generated filter matches nothing and compilation fails with tried to make discrete distribution over empty domain.

python3 ../run-scenic-scenario/scripts/list_scenic.py --check-maps

Read the 4way=N(uns M) / 3way=N(uns M) columns. Junction-negotiation scenarios need uns > 0; dense downtown maps are usually fully signalized.

Step 3: Blueprints that exist here

python3 scripts/blueprint_table.py                      # inventory + gaps
python3 scripts/blueprint_table.py --category bicycle   # ids Scenic offers
python3 scripts/blueprint_table.py --list vehicles      # what the build has
python3 scripts/blueprint_table.py --check vehicle.lincoln.mkz vehicle.lincoln.mkz_2017

Two lists, and they disagree. blueprint_table.py reads the build's own Content/Carla/Config/*Parameters.json — the definitive inventory — and diffs it against Scenic's table for the installed client version.

  • A category Scenic reports empty makes new Bicycle fail at sample time even when the build has bicycles. Name the id instead: with blueprint "vehicle.bh.crossbike".
  • An id in the build but absent from Scenic's table is still spawnable — reference it explicitly.
  • An id in neither fails at spawn time, long after sampling passed. This is how the upstream scenarios still carrying vehicle.lincoln.mkz_2017 behave.

Step 4: Spec, generate, validate

python3 scripts/scaffold_scenic.py --example > spec.json   # start from this shape
# edit spec.json
python3 scripts/scaffold_scenic.py --spec spec.json --out my.scenic

Generating with --out validates automatically. To re-validate after a hand edit:

python3 scripts/scaffold_scenic.py --validate my.scenic

Spec keys:

Key Meaning
map town name; needs a matching .xodr in the assets (required)
model srunner (default) or scenic — see [[run-scenic-scenario]]
placement lane for road situations, intersection for junction ones
arms, signalized intersection filter; signalized: false for negotiation
ego {blueprint, speed, maneuver}; maneuver is straight/left/right
actors[] {name, type, blueprint, relation, distance, speed, maneuver, offset, threshold}
requires[] extra require lines, verbatim
terminate termination condition; defa
Câu hỏi thường gặp

Kiểm tra có cần simulator không?

Không. File được biên dịch và lấy mẫu trước, nên không cần server.

Vì sao Scenic mô tả một khoảng cảnh thay vì một cảnh?

Scenic mô tả một tập hợp các tình huống có khả năng, nên mỗi lần chạy cho một cảnh hơi khác nhau nhưng vẫn khớp với mô tả của bạn.

Tôi có thể đặt người đi bộ trên đường không?

Có. Người đi bộ và vật thể đạo cụ có thể được đặt trên đường, và skill xử lý phần thiết lập của chúng.

Chi tiết

Mô tả gốc của tác giả

Writes a new Scenic scenario (.scenic) from a natural-language description — "a car cuts in from the right lane", "a pedestrian crosses in front of the ego", "negotiate an unsignalized four-way" — by turning the request into a spec, generating the file from idioms proven on this build, and validating it by compiling and sampling before any simulator is involved. Use when the user asks to "write a Scenic scenario", "create a .scenic file", "turn this description into Scenic", "generate a scenario from text", or wants a Scenic scenario authored or repaired.

repo: carla-simulator/carla

Độ phổ biến

Sao GitHub
15k
Vị trí xếp hạng
#11113
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự