world-data
它能做什么
这项技能按你的描述,例如一辆红色汽车或最近的行人,在运行中的 CARLA 模拟里搜索对象,并报告其 ID。适合想把其他工具指向正确对象的人。
适用场景
- ✓当你描述了某辆车或某个人,需要它的 ID 以便在另一步骤中使用时。
- ✓当你想找到离某点或另一对象最近的物体时。
- ✓当你需要模拟世界中所有内容的快照时。
技能链接
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/world-data/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能在 CARLA 模拟中找到离我的测试车最近的红色汽车,并告诉我它的 ID 吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体按类型、角色、颜色或距离筛选模拟中的对象,并不断缩小范围,直到只剩一个。然后报告该对象的 ID。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Query the world (and resolve entities)
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.
The resolver skill. Other skills act on one entity by id; this one finds that id when the request is a description — "a prius" (but there are three), "the nearest walker", "the 3rd vehicle". It also reads world-level data: snapshot, level bounding boxes, raycasts, ground projection.
Identifying a specific actor (the core use)
There is no ordering / rank — peer actors have no meaningful order, so "the 3rd one" is not a thing. Identify by a stable attribute or a spatial predicate, narrowing until one remains, then use its id:
- by type/blueprint:
--filter '*prius*',--filter walker.pedestrian.* - by role:
--role hero - by colour (tells identical models apart):
--color 255,0,0 - the single closest to a point/actor:
--near X,Y,Z/--near-id Nwith--nearest(a predicate — "the closest" — not an index) --fulldumps every attribute (colour, role, size, yaw), so you can spot the distinguishing field and filter by it (or just read the id)
So "the red prius" → actors --filter '*prius*' --color 255,0,0; "the prius
nearest the ego" → actors --filter '*prius*' --near-id <ego> --nearest. Either
yields an id to hand to telemetry / bounding-boxes / control-vehicle /
control-spectator. For junctions ("3-way intersections") use the map-waypoints
skill's junctions --arms 3.
Moving objects: a distance is a single-frame snapshot and changes as actors
move, so --nearest is only "closest right now". The id is the stable handle
— resolve once, then act on the id; re-query for a fresh distance. (An inherent
order only exists in special cases like a queue of vehicles along a lane — that is
a lane query, not this generic actor list.)
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: actors --filter/--role/--color [--nearest] until one remains → its id
- [ ] Step 3: hand the id to the action skill; or use snapshot/level-bbox/raycast/ground
Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh. Negative
coordinates: use the = form (--near=-24,-57,0.6).
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 2-3: Query
source scripts/env.sh
python3 scripts/world_data.py actors # everything (non-traffic)
python3 scripts/world_data.py actors --filter '*prius*' # all priuses (ids + locations)
python3 scripts/world_data.py actors --filter '*prius*' --full # + color/role/size to tell them apart
python3 scripts/world_data.py actors --filter '*prius*' --color 255,0,0 # the red one
python3 scripts/world_data.py actors --filter '*prius*' --near-id 100 --nearest # closest to actor 100
python3 scripts/world_data.py snapshot # frame / time / count
python3 scripts/world_data.py level-bbox --label TrafficSigns # static boxes by label
python3 scripts/world_data.py raycast --from=0,0,1 --to=50,0,1 # semantic hits along a ray
python3 scripts/world_data.py ground --at=20,20,50 # drop to the ground
python3 scripts/world_data.py ros-topics # ROS 2 topic tree per actor
Resolving ROS 2 topics (ros-topics)
The same resolver job, one level up: it maps live actors to the topics the server
should be publishing, and names the reason for each silent one. It needs no
ROS 2 installation — it derives the names the way the server does, so it answers
the half ros2 topic list cannot ("the topic is missing — why?").
world topics (exist whenever the server runs with --ros2):
rt/clock [rosgraph_msgs/Clock] every tick
rt/carla/map [std_msgs/String] OpenDRIVE, LATCHED, re-sent on map load
rt/tf [tf2_msgs/TFMessage] per registered actor, unless ros_publish_tf=false
hero vehicle(s): 1
id=112 vehicle.lincoln.mkz_2017 ros_name=hero
<- rt/carla/hero/vehicle_control_cmd [carla_msgs/CarlaEgoVehicleControl]
<- rt/carla/hero/ackermann_control_cmd [ackermann_msgs/AckermannDriveStamped]
sensors: 2
id=113 sensor.camera.rgb ros_name=front [NOT enabled_for_ros -> SILENT]
-> rt/carla/hero/front/image [sensor_m
常见问题
如果多个对象符合我的描述怎么办?
这项技能会继续用某个可区分的细节缩小范围,因为对象本身没有有意义的顺序可供排名。
它能查询地图的布局信息吗?
可以。它可以按标签读取地图物体的包围盒,并将某点投影到地面上。
它能帮忙处理 ROS 2 话题吗?
可以。它可以列出每个对象应发布的 ROS 2 话题,并解释为什么某个话题没有输出。
详情
作者的原始描述
Queries the live CARLA world and resolves an entity description into a concrete actor id — find actors by type, role, or colour, or the single one nearest a point/actor; read the world snapshot; get static level bounding boxes by label; cast rays for semantic points; project a point to the ground; or (ros-topics) list the native ROS 2 topics each actor should be publishing and why any is silent. Identifies by stable attributes, not by any rank/order. Use when the user asks "what actors are here", "find the red prius", "the vehicle nearest the ego", "list the pedestrians", or needs a specific a
repo: carla-simulator/carla
热度
- GitHub 星标
- 15k
- 排名
- #11106
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-leaderboard-route
15k帮你的智能体通过在模拟器视角中放置路径点和场景触发器,构建 CARLA Leaderboard 路线文件,并对其进行检查和排序。
package-leaderboard-agent
15k帮你的智能体把驾驶智能体打包成 Docker 镜像,用于提交 CARLA Leaderboard,并检查文件夹结构,测试镜像能否加载它。
read-leaderboard-results
15k帮你的智能体阅读 CARLA Leaderboard 结果文件,解释每条路线的得分和违规情况,并按另一规则版本重新计分。
run-leaderboard-evaluation
15k帮你的智能体用你的驾驶智能体在一组路线上运行 CARLA Leaderboard 评估器,先检查设置,并保存可以恢复的检查点。