Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)15k · #11120

install-scenic

Skill này làm gì

Skill cài Scenic, một công cụ để viết kịch bản kiểm thử giao thông, để nó hoạt động với simulator CARLA của bạn. Skill dành cho người định viết hoặc chạy kịch bản Scenic.

Khi nào nên dùng

  • ✓Khi bạn muốn bắt đầu viết kịch bản Scenic cho CARLA.
  • ✓Khi bạn đã có client Python của CARLA và cần Scenic hoạt động cùng nó.
  • ✓Khi một kịch bản Scenic lỗi do mô hình hoặc blueprint sau khi cài đặt.

Liên kết skill

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/setup/install-scenic/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/setup/install-scenic/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ể cài Scenic để tôi viết kịch bản giao thông cho simulator CARLA và kiểm tra nó hoạt động với thiết lập của tôi không?”

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

Cách hoạt động

Agent cài Scenic vào cùng môi trường Python với client CARLA, vì hai bên phải hoạt động cùng nhau. Nó cũng có thể tải các kịch bản mẫu, rồi kiểm tra lệnh Scenic, client và các bảng phiên bản đều khớp.

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.

Install Scenic

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 is pure Python — there is nothing to build and pip install scenic is the whole install. Two things make it go wrong anyway, and neither reports an install error:

  1. The scenic CLI and the carla client must be in ONE interpreter. Scenic loads the client itself when a scenario names the CARLA model. Split them and the failure arrives mid-run as a model import error, not at install time.
  2. Scenic's blueprint tables are keyed on the CARLA client version. With no table for that version, every vehicle and prop category resolves empty and every scenario fails at sample time with "no blueprints recorded".

So the install order is client first, Scenic second, into the same interpreter. install_scenic.py refuses to install into an interpreter with no client unless you pass --force.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh)
- [ ] Step 2: Pick the interpreter — the one that has the CARLA client
- [ ] Step 3: See the plan for this machine
- [ ] Step 4: Install (and clone examples if they are wanted)
- [ ] Step 5: Verify, and record `SCENIC_ROOT` and `PYTHON` with `set_config`

Step 1-3: What is here, and what to do about it

PYTHON=/path/to/venv/bin/python bash scripts/check_env.sh

python3 scripts/install_scenic.py detect     # interpreter, Scenic, client, tables
python3 scripts/install_scenic.py plan       # the exact commands, and why

Every subcommand takes --python to act on another interpreter:

python3 scripts/install_scenic.py --python ~/.venvs/carla/bin/python detect

detect is the one to read first. It prints which CARLA versions the installed Scenic has blueprint tables for, and flags a CLI that belongs to a different environment than the interpreter — the pyenv-shim trap, which otherwise surfaces much later as a confusing model import failure.

Step 4: Install

# into the interpreter that has the client
python3 scripts/install_scenic.py install

# a specific version
python3 scripts/install_scenic.py install --version 3.1.1

# also clone upstream for the example scenarios and map assets
python3 scripts/install_scenic.py install --clone ~/Scenic

The wheel ships world models only — no example scenarios and no map assets. --clone is how you get examples/ and assets/maps/CARLA/*.xodr. Skip it if you are running a ScenarioRunner checkout's own scenarios, which carry their own copies under srunner/scenic/.

install runs verify when it finishes.

Step 5: Verify and export

python3 scripts/install_scenic.py verify

Checks the five things that actually matter, and exits non-zero on any:

Check Why it matters
scenic importable the install worked
CLI belongs to this interpreter otherwise a run uses a different Scenic
carla client present Scenic loads it for the CARLA model
carla is the extension, not a directory a directory named carla on sys.path imports as an empty namespace package
blueprint table for this client version otherwise every category is empty
scenic.simulators.carla.simulator imports the real binding between Scenic and the client

Then export the root, which is what the scenic skill group is gated on:

export SCENIC_ROOT=~/Scenic           # a checkout, for examples
# or, for a pip-only install, the installed package directory:
export SCENIC_ROOT=$(python3 -c 'import os,scenic;print(os.path.dirname(scenic.__file__))')

Running and authoring scenarios is out of scope here — see [[run-scenic-scenario]] and [[create-scenic-scenario]].

Recording the path

An export lasts until the shell exits. Persist SCENIC_ROOT and PYTHON instead, so the next session — and list_skills — still knows where this went:

set_config({"SCENIC_ROOT": "<the checkout or package dir>",
            "PYTHON": "<the interpreter Scenic went into>"})

Without it the group this just enabled keeps reporting available: false, and the next skill re-detects from scratch. CARLA_ROOT is the only CARLA path to record: set_config derives the engine-specific variable itself.

Examples

**Example 1: "install Sce

Câu hỏi thường gặp

Vì sao Scenic và client CARLA phải dùng chung một Python?

Scenic tự nạp client CARLA, nên các bản cài riêng sẽ gây lỗi giữa chừng khi chạy.

Có cần các kịch bản mẫu không?

Không, nhưng skill có thể tải các kịch bản mẫu mà gói không đi kèm.

Vì sao không khớp phiên bản lại quan trọng?

Scenic liệt kê xe theo phiên bản client, nên nếu không khớp, kịch bản có thể không có xe nào để dùng.

Chi tiết

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

Installs Scenic, the probabilistic scenario description language, for the CARLA in use — pip installing it into the same interpreter that holds the CARLA client, optionally cloning the upstream repo for the example scenarios the wheel does not ship, and verifying that the `scenic` CLI, the client and Scenic's version-keyed blueprint table all agree. Use when the user asks to "install Scenic", "set up Scenic", "download Scenic", "pip install scenic", wants to run `.scenic` files, or has a Scenic whose model import or blueprint lookup fails.

repo: carla-simulator/carla

Độ phổ biến

Sao GitHub
15k
Vị trí xếp hạng
#11120
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ự