create-sensor
यह क्या करती है
यह स्किल CARLA सिमुलेशन में किसी वाहन या दूसरे एक्टर पर सेंसर लगाती है। यह उन डेवलपर्स के लिए है जो स्वायत्त ड्राइविंग टेस्ट के लिए सेंसर डेटा इकट्ठा करते हैं।
कब इस्तेमाल करें
- ✓जब आप सिमुलेटेड कार पर कैमरा, लिडार या कोई दूसरा सेंसर चाहते हैं।
- ✓जब आप सेंसर की स्थिति, रिज़ॉल्यूशन या अपडेट दर सेट करना चाहते हैं।
- ✓जब आप चाहते हैं कि सेंसर अपना डेटा ROS 2 पर भेजे।
Skill का लिंक
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/create-sensor/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“ego कार के सामने 800 बाय 600 का कैमरा और छत पर एक लिडार जोड़िए, फिर मुझे उनकी ID दीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट सेंसर ब्लूप्रिंट स्पॉन करता है, उसे चुने गए एक्टर पर माउंट पोज़िशन के साथ जोड़ता है, और रिज़ॉल्यूशन, फ़ील्ड ऑफ़ व्यू और अपडेट दर जैसी विशेषताएँ सेट करता है। वह सेंसर की ID दिखाता है, ताकि आप बाद में उसे पढ़ सकें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Create 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.
Spawn a sensor and (usually) attach it to a vehicle so it moves with it. The
sensor persists as an actor; its id is printed so the
read-sensor skill can save or display its data. This
skill is placement/lifecycle only — reading is the other skill.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Have a parent actor if attaching (spawn-vehicles ego)
- [ ] Step 3: Spawn the sensor with a type, mount transform, and attributes
- [ ] Step 4: Note the printed id; read it with read-sensor; destroy when done
Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh.
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 3: Spawn
source scripts/env.sh
python3 scripts/sensors.py types # list sensor blueprints
# an 800x600 dashcam on the ego (default mount x=1.5, z=2.4)
python3 scripts/sensors.py spawn --type camera.rgb --attach-to hero \
--attr image_size_x=800 --attr image_size_y=600 --attr fov=90
# a lidar on the ego roof
python3 scripts/sensors.py spawn --type lidar.ray_cast --attach-to hero --z 2.5 \
--attr range=50 --attr points_per_second=200000 --attr rotation_frequency=20
# a depth camera; a GNSS; a collision sensor
python3 scripts/sensors.py spawn --type camera.depth --attach-to hero
python3 scripts/sensors.py spawn --type other.gnss --attach-to hero
python3 scripts/sensors.py spawn --type other.collision --attach-to hero
python3 scripts/sensors.py destroy # remove all sensors
# turn ROS publishing on for sensors that already exist
python3 scripts/sensors.py ros --id 123
python3 scripts/sensors.py ros --filter 'sensor.camera.*' --disable
--attach-to <role> attaches to that vehicle (ego = hero); --parent-id N
attaches to any actor; omit both for a world-fixed sensor. --attachment SpringArm
gives a smooth chase mount. Repeat --attr key=value for blueprint attributes.
Publishing to ROS 2
Only meaningful on a server started with --ros2 ([[run-carla-server]] ROS2=1).
# a lidar that publishes on rt/carla/hero/lidar/point_cloud
python3 scripts/sensors.py spawn --type lidar.ray_cast --attach-to hero --z 2.4 \
--ros --ros-name lidar
# a camera with its own TF frame and no transform broadcast
python3 scripts/sensors.py spawn --type camera.rgb --attach-to hero \
--ros --ros-name front --ros-frame-id front_cam --no-ros-tf
--ros is not optional decoration — without it the sensor publishes nothing.
A CARLA sensor is only ticked while something listens to its stream
(ASensor::Tick returns early otherwise), and enable_for_ros() is what marks
the stream as listened-to without a Python client. --ros-name/--ros-frame-id/
--no-ros-tf set the ros_name / ros_frame_id / ros_publish_tf blueprint
attributes, which the server reads once at registration: they cannot be
changed after spawn.
Topic layout (spawn prints the exact list):
| Sensor | Topics under the base name | Type |
|---|---|---|
| any camera | /image, /camera_info |
sensor_msgs/Image, CameraInfo |
camera.dvs |
/image, /camera_info, /point_cloud |
+ PointCloud2 |
lidar.*, other.radar |
/point_cloud |
sensor_msgs/PointCloud2 |
other.imu |
(the base name itself) | sensor_msgs/Imu |
other.gnss |
(the base name itself) | sensor_msgs/NavSatFix |
other.collision |
(the base name itself) | carla_msgs/CarlaCollisionEvent |
other.lane_invasion, other.obstacle, other.rss |
none — no native publisher exists | — |
Base name is rt/carla/<ros_name>, nested as
rt/carla/<parent ros_name>/<ros_name> when attached; unnamed sensors become
actor<id>. Transforms go to the single rt/tf topic, parented to the attach
parent's frame (or map).
All of this is verified against a live server: a lidar spawned as
--attach-to hero --ros-name lidar without --ros produced no topic at all;
ros --id N made /carla/hero/lidar/point_cloud and /tf appear at once —
/tf exists only because a sensor publishes, never from the vehicle alone. Two
practical notes:
- Rates follow the tick. With `s
अक्सर पूछे जाने वाले सवाल
क्या यह स्किल सेंसर का डेटा पढ़ती है?
नहीं। यह सेंसर लगाती और संभालती है, उसका आउटपुट पढ़ना एक अलग स्किल का काम है।
डिफ़ॉल्ट माउंट पोज़िशन क्या है?
डिफ़ॉल्ट रूप से वाहन पर 1.5 मीटर आगे और 2.4 मीटर ऊपर।
कौन-से सेंसर प्रकार उपलब्ध हैं, यह कैसे देखूँ?
स्किल में एक types कमांड है, जो सेंसर ब्लूप्रिंट की सूची दिखाता है।
जानकारी
लेखक का मूल विवरण
Spawns and attaches sensors on a running CARLA server — cameras (rgb/depth/semantic/instance/optical-flow/normals), lidar, radar, IMU, GNSS, collision/lane-invasion/obstacle — to the ego or any actor, with a mount transform and blueprint attributes (resolution, fov, sensor_tick, lidar range/points, …). Also sets up native ROS 2 publishing (--ros to enable_for_ros, --ros-name/--ros-frame-id topic and TF naming) and prints the topics the sensor will publish. Use when the user asks to "add a camera/lidar/sensor", "put a dashcam on the ego", "attach a depth camera", "mount a sensor", or "publish a
repo: carla-simulator/carla
लोकप्रियता
- GitHub स्टार
- 15k
- रैंकिंग में स्थान
- #11090
- लाइसेंस
- 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
blucli
394kयह आपके एजेंट को blu कमांड से Bluesound और NAD स्पीकर खोजने, चलाने, रोकने, समूह बनाने और वॉल्यूम बदलने में मदद करती है।
camsnap
394kयह आपके एजेंट को नेटवर्क कैमरों और लोकल webcam से स्नैपशॉट, छोटी क्लिप या मोशन इवेंट लेने में मदद करती है, जो आपने सेट किए हों।
eightctl
394kयह आपके एजेंट को Eight Sleep pod की जांच और नियंत्रण करने में मदद करती है, जिसमें तापमान, अलार्म और नींद की समय-सारणी शामिल हैं।