read-sensor
하는 일
이 스킬은 시뮬레이션 차량에 달린 센서의 출력을 읽습니다. 센서가 기록하는 내용을 보거나 저장하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓시뮬레이션 차량의 카메라나 라이다 스트림을 보고 싶을 때.
- ✓센서 데이터를 나중에 쓰려고 파일로 저장하고 싶을 때.
- ✓센서의 최신 데이터를 빠르게 요약해서 보고 싶을 때.
스킬 링크
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/read-sensor/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“전면 카메라의 실시간 영상을 보여 주고, 각 프레임을 폴더에 저장해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 ID, 유형, 또는 연결된 차량으로 센서를 찾은 뒤 스트림을 듣습니다. 카메라 프레임은 PNG 파일로, 라이다 데이터는 포인트 클라우드 파일로 저장하거나, 창에 데이터를 표시할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Read a sensor
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.
Point this at an existing sensor (make one with create-sensor)
and either show it in a window, save its stream to disk, or get a one-shot
info summary. The goal is: select a sensor → see it.
Selector (any one): --id N · --type sensor.camera.rgb · --attached-to hero.
Capture in lock-step, not as an observer
save takes the world's clock when the world is asynchronous, then ticks it
once per frame: one tick, one frame. --no-sync keeps the old passive
behaviour, and if another client already owns the clock this one observes
instead (the clock rule the spawn skills follow).
This is not a nicety. Capturing as a passive observer wedges the recording client on this build. Measured against a healthy server, with the world ticking and a second client still able to pull frames from the very same sensor:
| write path | frames before it froze |
|---|---|
save_to_disk inside the listen callback, HD |
396 |
| same, 720p | 147 |
save_to_disk moved to the main loop, queued |
222 |
own cv2 encode from raw_data |
248 |
| lock-step, client owns the clock | 401 of 401, no stall |
Every observer variant froze in futex_wait with no error and no further
I/O — so the write path was never the cause, the delivery model was. Replacing
save_to_disk and then the encoder was wasted effort; owning the clock fixed
it outright, and matches the pattern that captured 5388 frames for a video on
this same build.
Two consequences worth knowing:
- Timing is exact. 401 frames over 20.00 s of simulated time at 20 Hz, nothing dropped or duplicated, and the run is reproducible.
save_to_diskis still avoided for camera frames: the buffer is converted and written here (cv2, falling back to PIL). That change did not fix the stall on its own, but it keeps the encode where its cost is visible.
The duration budget is read off the world clock (elapsed_seconds), not summed
from per-frame deltas: summing counts observed frames, so a consumer slower
than the server takes minutes to "reach" 20 seconds.
Live Traffic Manager traffic and a lock-step capture are incompatible
Measured on 0.10.0: with the camera owning a 20 Hz clock and a [[spawn-vehicles]] holder attached as an observer, all 40 vehicles stood still for the whole 500-frame capture. The Traffic Manager lives in the process that created it and only steps when that process ticks the world, so a TM held by one client and a clock owned by another never advances. Traffic moved in earlier tests only because the holder was itself the ticker — and a holder that ticks forces this capture into observer mode, which is what wedges it.
So pick one:
| what you want | how |
|---|---|
| a capture with moving traffic | record the traffic first, then replay it into a lock-step capture. The replayer is server-side, needs no TM, and moved 33 of 50 replayed vehicles under the camera's clock |
| live TM traffic on screen, no frame capture | let the traffic holder own the clock and watch it in the window |
| a capture of a static scene | camera alone, as above |
The replay recipe, in order:
# 1. record the traffic while its holder owns the clock
python3 ../spawn-vehicles/scripts/vehicles.py spawn --count 50 --base-type car --hold &
python3 ../record-simulation/scripts/record.py clip --file /tmp/traffic.log --seconds 20
# 2. stop the holder, clear the scene, spawn the camera
# 3. capture in lock-step while the replay feeds the actors
python3 scripts/read_sensor.py save --id <cam> --out ./frames --seconds 20 &
python3 ../replay-recording/scripts/replay.py play --file /tmp/traffic.log --duration 20 --keep-scene
--keep-scene matters in step 3: without it the replay skill stops holders and
puts the world back to asynchronous, which takes the clock away from the
capture.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Make sure the sensor exists (create-sensor) and the world is ticking
- [ ] Step 3: info (sanity) → show (window) or save (dataset)
Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh.
Step 1: Check prerequisites
bash scripts/
자주 묻는 질문
저장하면 시뮬레이션의 속도가 맞춰지나요?
네. 월드가 비동기로 실행될 때 스킬이 시계를 직접 제어하므로, 한 틱마다 저장된 프레임이 하나씩 생깁니다.
어떤 형식으로 저장하나요?
카메라는 PNG 파일로, 라이다는 PLY 포인트 클라우드 파일로 저장합니다.
대신 ROS에서 센서를 읽을 수 있나요?
네. 이 스킬은 센서의 ROS 2 토픽을 알려 주므로, ROS에서 읽을 수 있습니다.
상세 정보
작성자의 원본 설명
Listens to a CARLA sensor and either saves its data to files, shows it live in a window, prints a one-shot summary, or (ros-info) reports the native ROS 2 topics, QoS and enabled-for-ROS state so you can echo it from ROS instead. Cameras save as PNG (depth/semantic auto-colourised) and display in a pygame window; lidar saves as .ply and shows as a top-down scatter; IMU/GNSS/radar/collision stream to JSONL or the console. Use when the user asks to "show/view the camera", "display the lidar", "save the sensor data / capture a dataset", or "what is this sensor reading". Select the sensor by id, t
repo: carla-simulator/carla
인기도
- GitHub 스타
- 15k
- 순위
- #11097
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-leaderboard-route
15k카메라 화면에서 웨이포인트와 시나리오 트리거를 배치하고, 확인하고, 순서를 정해 CARLA 리더보드 경로 파일을 만들도록 에이전트를 돕습니다.
package-leaderboard-agent
15k주행 에이전트를 CARLA Leaderboard 제출용 Docker 이미지로 패키징하고, 폴더 구조를 확인하며 이미지가 에이전트를 로드하는지 테스트하도록 돕습니다.
read-leaderboard-results
15kCARLA Leaderboard 결과 파일을 읽고 경로별 점수와 위반 사항을 설명하며, 다른 규칙 버전에서 실행을 다시 채점하도록 에이전트를 돕습니다.
run-leaderboard-evaluation
15k주행 에이전트로 경로 세트에 대한 CARLA Leaderboard 평가를 실행하도록 돕습니다. 먼저 설정을 확인하고, 재개할 수 있는 체크포인트를 저장합니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.