spawn-vehicles
Qué hace
Esta skill añade coches a una simulación de carreteras de CARLA en marcha y los quita cuando terminas. Está pensada para personas que desarrollan o prueban software de conducción autónoma y necesitan tráfico en la carretera.
Cuándo usarla
- ✓Cuando quieres carreteras llenas de coches que circulan solos.
- ✓Cuando necesitas un único coche de prueba en la carretera para que tu software lo controle.
- ✓Cuando quieres quitar los coches que añadiste para que la simulación quede vacía de nuevo.
Link de la skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/spawn-vehicles/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Añade 40 coches autónomos a mi simulación de carreteras de CARLA y quítalos cuando termine.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente coloca los coches en los puntos de aparición del mapa y entrega cada uno al sistema de tráfico, que lo conduce por las carreteras. Quitarlos elimina esos coches de la simulación.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Spawn autopilot vehicles
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.
Populate the roads with self-driving traffic. Vehicles are placed at the map's
predefined spawn points and, by default, handed to the Traffic Manager
autopilot at spawn time so they drive the road network autonomously. destroy
removes them.
spawn and line make the world synchronous. The Traffic Manager is not
reliable driving an asynchronous server: it runs its own loop against a server
advancing at whatever rate it likes. Measured on 0.10.0, async, 50 autopilot
vehicles with the spawning client alive and holding the TM: only 24 were
moving, and the actor count decayed on its own — 50 vehicles down to 39 and 15
walkers down to 5 over a couple of minutes. With a fixed timestep and the TM in
sync, 37 of 50 move and nothing decays. --no-sync keeps the old behaviour.
The TM cannot be driven by another client's tick
The Traffic Manager steps only when the process that created it ticks the world. Measured on 0.10.0: with a camera client owning a 20 Hz clock and this skill attached as an observer, its 40 vehicles never moved at all — no error, just a frozen scene. So a held traffic pool and a lock-step frame capture cannot share a world; record the traffic here and replay it into the capture instead ([[read-sensor]] has the recipe).
The clock rule
The world settings are read before anything else happens:
- asynchronous — this client switches it to synchronous (
--delta, default 0.05 s = 20 Hz), puts the TM in sync, and becomes the ticker. - already synchronous — another client owns the clock. This one never calls
tick(); it observes withwait_for_tick(). Ticking a world you do not own silently drops commands — it is what stoppedspawn-walkers'start()from landing.
The previous settings are restored on release, because a synchronous world with
nothing ticking does not advance and looks exactly like a hung server. Stop a
holder with Ctrl+C, never kill -9: the restore is in a finally.
The Traffic Manager lives in the client process that created it. So a
spawn that exits leaves the vehicles registered with a dead TM: they sit at
throttle 0.00 for ever, in async and sync. Pass --hold to keep the TM
open (Ctrl+C releases it, and the vehicles then coast to a stop). Measured on
0.10.0: without --hold, 0/50 vehicles move; with it, 49/50 move.
The same is true of controller.ai.walker in [[spawn-walkers]] — its
controllers stop when their client exits — so a scene with both wants two
resident processes: this one owning the clock, the walker one held as an
observer.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Spawn N vehicles with --hold (the TM dies with the process without it)
- [ ] Step 3: Verify visually / via the world-data skill; spawn reports its count
- [ ] Step 4: Ctrl+C the held process, then destroy when done
Commands need CARLA_HOST/CARLA_PORT/TM_PORT from scripts/env.sh.
Negative coordinates: pass --at with an = (--at=-24,-57,0.6) so the
leading minus isn't parsed as a flag.
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 2-4: Spawn / list / destroy
source scripts/env.sh
# 40 vehicles driving around on autopilot — --hold keeps the TM (and so the
# driving) alive; without it they spawn, then freeze when this command returns.
# The world is put in sync at 20 Hz and this client ticks it.
python3 scripts/vehicles.py spawn --count 40 --hold
# leave the world asynchronous (the old behaviour; the TM misbehaves)
python3 scripts/vehicles.py spawn --count 40 --hold --no-sync
# a different fixed timestep
python3 scripts/vehicles.py spawn --count 40 --hold --delta 0.033
# four-wheeled cars only, reproducible
python3 scripts/vehicles.py spawn --count 30 --safe --seed 42
# only Teslas, parked (no autopilot)
python3 scripts/vehicles.py spawn --count 10 --filter 'vehicle.tesla.*' --no-autopilot
# 5 vehicles in one lane, 15 m apart, starting near (x,y,z)
python3 scripts/vehicles.py line --at 30,20,0 --count 5 --gap 15
# ...as a static queue (no autopilot), laid behind the point
python3 scripts/vehicles.py line --at 30,20,0 --count 5 --gap 15 --
Preguntas frecuentes
¿Puedo elegir qué tipo de coches aparecen?
Sí. La skill puede filtrar qué modelos de coche se usan, para elegir ciertos tipos en lugar de aleatorios.
¿Funciona con un simulador lento o inestable?
La skill pone el simulador en modo paso a paso, que el sistema de tráfico necesita para conducir de forma fiable.
¿Puedo colocar un coche concreto en lugar de tráfico?
Sí. Se puede colocar un único vehículo hero o ego, y se le puede dar un nombre para publicar en ROS 2.
Detalles
Descripción original del autor
Spawns vehicles on a running CARLA server and destroys them — scattered across the map's spawn points on Traffic Manager autopilot, a row queued in a single lane at a fixed spacing, or a single hero/ego vehicle (optionally named for native ROS 2 publishing with --ros-name). Covers blueprint filtering, the atomic autopilot hand-off, and cleanup. Use when the user asks to "spawn vehicles/cars/traffic", "add N cars driving around", "put cars in a lane 15 m apart", "spawn the ego/hero vehicle", or "remove the vehicles".
repo: carla-simulator/carla
Popularidad
- Estrellas en GitHub
- 15 mil
- Posición en el ranking
- #11102
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
create-leaderboard-route
15 milAyuda a tu agente a crear rutas para el Leaderboard de CARLA, colocando puntos de paso y disparadores de escenario desde la cámara del simulador.
package-leaderboard-agent
15 milAyuda a tu agente a empaquetar un agente de conducción en una imagen de Docker para el Leaderboard de CARLA, y comprueba que la imagen lo carga.
read-leaderboard-results
15 milAyuda a tu agente a leer los resultados del Leaderboard de CARLA, explicar la puntuación e infracciones de cada ruta y recalcular la ejecución con otra versión de las reglas.
run-leaderboard-evaluation
15 milAyuda a tu agente a ejecutar el evaluador del Leaderboard de CARLA en un conjunto de rutas, revisando antes la configuración y guardando puntos de control.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.