read-sensor
यह क्या करती है
यह स्किल सिमुलेटेड वाहन पर लगे सेंसर का आउटपुट पढ़ती है। यह उन डेवलपर्स के लिए है जो देखना या सेव करना चाहते हैं कि सेंसर क्या रिकॉर्ड करता है।
कब इस्तेमाल करें
- ✓जब आप सिमुलेटेड कार के कैमरा या लिडार का लाइव स्ट्रीम देखना चाहते हैं।
- ✓जब आप बाद में इस्तेमाल के लिए सेंसर डेटा फ़ाइलों में सेव करना चाहते हैं।
- ✓जब आप सेंसर के सबसे नए डेटा का त्वरित सारांश चाहते हैं।
Skill का लिंक
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/read-sensor/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“सामने वाले कैमरे का लाइव फ़ीड दिखाइए, और हर फ़्रेम एक फ़ोल्डर में सेव कीजिए।”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 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
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।