control-spectator
Skill này làm gì
Skill hướng camera hiển thị trong mô phỏng CARLA. Skill dành cho người muốn xem một xe cụ thể hoặc nhìn bản đồ từ một góc đã chọn.
Khi nào nên dùng
- ✓Khi bạn muốn đưa camera simulator đến một vị trí cụ thể.
- ✓Khi bạn muốn bám theo một xe từ phía sau hoặc từ ghế tài xế.
- ✓Khi bạn muốn góc nhìn từ trên cao hoặc từ phía trước của một xe được gọi tên.
Liên kết skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/control-spectator/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
“Hãy cho tôi góc nhìn đuổi theo ngôi thứ ba của xe ego và giữ cho nó bám theo.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm actor từ lời bạn mô tả, như xe ego hoặc một xe được gọi tên, rồi đưa camera đến một góc nhìn có sẵn. Để bám theo trực tiếp, agent đặt lại vị trí camera ở mỗi tick của thế giới, vì camera không thể gắn vào một actor.
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.
Control the CARLA spectator
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.
Aim the on-screen camera (the "spectator"). Move it to a pose, frame an actor in a preset view, or follow a moving actor. The spectator cannot be attached to an actor (the API has no reparent for it) — following is emulated by re-setting its transform every world tick.
Resolving the target from words
Like the other skills, this emits structured data (actors) and the agent
filters it:
- "the ego" →
--role hero(CARLA's ego role_name is usuallyhero). - "the Toyota Prius" →
--filter '*prius*'(orvehicle.toyota.prius). - a specific one →
--id N.
"3rd-person view of the ego" → follow --view chase --role hero. "1st-person of
the prius" → follow --view first --filter '*prius*'. On multiple matches it
picks the nearest and says so — run actors first if you need to choose.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Resolve the target (actors) if the request names an actor
- [ ] Step 3: move / look (one-shot) / follow (live) in the requested view
Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh. Only useful on a
rendered server (windowed or packaged) — the spectator is that window's camera.
Negative coordinates: pass move --at with an = (--at=-24,-57,20) so the
leading minus isn't parsed as a flag.
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 2-3: Aim it
source scripts/env.sh
# list actors to resolve a name
python3 scripts/spectator.py actors
python3 scripts/spectator.py actors --filter '*prius*'
# move to an explicit pose (looking slightly down)
python3 scripts/spectator.py move --at 40,20,15 --pitch -30 --yaw 90
# one-shot framing (no loop): chase view of the ego
python3 scripts/spectator.py look --view chase --role hero
# live follow for 30s: 1st-person of the prius
python3 scripts/spectator.py follow --view first --filter '*prius*' --seconds 30
# bird's-eye follow of actor 87
python3 scripts/spectator.py follow --view top --id 87 --seconds 20
Views: chase (3rd-person behind+above), first (driver), top (bird's eye),
front (ahead, looking back). Tune with --distance/--height/--pitch.
Examples
Example 1: 3rd-person of the ego
User says: "give me a 3rd-person view of the ego"
follow --view chase --role hero --seconds 30. The camera chases the hero from
behind and above.
Example 2: 1st-person of a named car
User says: "1st-person view of the Toyota Prius"
follow --view first --filter '*prius*'. If several Priuses exist it uses the
nearest and reports the id; run actors --filter '*prius*' to pick a specific one.
Example 3: park the camera and look at a spot
User says: "look at the crossroads at (42,24)"
move --at 42,54,20 --pitch -35 --yaw -90 (offset back from the point and angle
down), or look at a nearby actor.
Troubleshooting
Problem: nothing changes on screen
Cause: headless -nullrhi server (no window), or you're viewing a different
client's camera.
Solution: use a windowed/packaged server; the spectator is that view.
Problem: follow doesn't track in sync mode
Cause: it updates on world ticks; in sync mode nothing ticks unless a client does.
Solution: run the tick loop (set-world-settings), or follow in async mode.
Problem: "can I attach the spectator to the car?"
Answer: not directly — the API can't reparent the spectator. follow gives the
same effect by updating its transform each tick. For a recorded/attached camera,
spawn a camera sensor with SpringArm attachment (create-sensor skill).
Problem: wrong actor chosen
Cause: several actors matched the selector.
Solution: run actors and pass --id, or narrow --filter.
Outputs
Server-side camera state (the on-screen view). follow runs for --seconds then
stops cleanly. No file produced.
Detail (view math, attachment vs following, selector semantics, sync-mode) in references/spectator.md.
Câu hỏi thường gặp
Camera có thể dính chặt vào một xe không?
Không trực tiếp. Skill bám theo xe bằng cách cập nhật vị trí camera ở mỗi tick.
Có những góc nhìn nào?
Góc đuổi theo, góc thứ nhất, góc từ trên xuống và góc từ phía trước.
Nếu nhiều xe khớp với mô tả của tôi thì sao?
Skill chọn xe gần nhất và nói rõ điều đó, và bạn có thể liệt kê các kết quả khớp trước.
Chi tiết
Mô tả gốc của tác giả
Moves the CARLA spectator camera, frames an actor, or follows one live — third-person/chase, first-person/driver, top-down, or front views, resolving natural-language targets like "the ego" or "the Toyota Prius" to a specific actor. Use when the user asks to "move the camera/spectator", "watch/follow vehicle X", "3rd-person view of the ego", "1st-person view of the prius", "bird's-eye view", or "look at (x,y,z)".
repo: carla-simulator/carla
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11086
- 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ự
blucli
394kGiúp agent của bạn tìm, phát, tạm dừng, nhóm và chỉnh âm lượng loa Bluesound và NAD qua lệnh blu.
camsnap
394kGiúp agent của bạn chụp ảnh, quay clip ngắn hoặc lấy sự kiện chuyển động từ camera mạng và webcam nội bộ mà bạn đã thiết lập.
eightctl
394kGiúp agent của bạn kiểm tra và điều khiển thiết bị Eight Sleep pod, gồm nhiệt độ, báo thức và lịch ngủ.