spawn-vehicles

Spawns and destroys autopilot vehicles on a running CARLA server via the Python API.

3|Updated Jul 20, 2026
One-click install
npx skills add https://github.com/carla-simulator/carla-agentic-tools --skill spawn-vehicles-carla-simulator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spawn-vehicles
Source: https://github.com/carla-simulator/carla-agentic-tools/tree/main/skills/python-api/spawn-vehicles
Command: npx skills add https://github.com/carla-simulator/carla-agentic-tools --skill spawn-vehicles-carla-simulator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires carla, and includes scripts (resource) and references (resource) components.

What problem does it solve? Populating a CARLA simulation with traffic by hand is error-prone: vehicles freeze when the Traffic Manager dies with its client process, synchronous worlds hang when nothing ticks them, and spawn points collide. This Skill encodes those failure modes into a tested procedure so an agent can spawn driving traffic, lane queues, or a hero vehicle correctly on the first attempt. ## Core Features & Use Cases - Autopilot traffic at spawn points: Scatter N vehicles across the map's spawn points with an atomic SpawnActor-then-SetAutopilot hand-off to the Traffic Manager, with blueprint filtering, --safe four-wheel selection, and seeded reproducibility. - Lane queues and hero vehicles: Place a row of vehicles in a single lane at a fixed gap using the Waypoint API, or spawn one ego vehicle with role_name hero and optional ROS 2 naming for control topics. - Clock and TM lifecycle management: Automatically switches the world to synchronous mode, holds the Traffic Manager alive with --hold, and restores previous world settings on release. - Use Case: A user asks to "spawn 50 cars driving around" — the Skill checks prerequisites, spawns 50 vehicles on autopilot with --hold, and later destroys them cleanly when the user is done. ## Quick Start Ask the agent to spawn 40 cars driving around on autopilot on the running CARLA server, then destroy them when finished.

Frequently Asked Questions about spawn-vehicles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I spawn autopilot vehicles in CARLA with Python?▼

Run the vehicles.py spawn command with a count and --hold, for example python3 scripts/vehicles.py spawn --count 40 --hold. Vehicles are placed one per map spawn point and handed to the Traffic Manager atomically at spawn time.

How do I spawn a hero or ego vehicle in CARLA for ROS 2?▼

Use the ego subcommand with --ros-name, for example python3 scripts/vehicles.py ego --at 30,20,0 --ros-name hero. Only a vehicle with role_name hero is registered with the ROS 2 layer, creating vehicle_control_cmd and ackermann_control_cmd subscriptions.

Why do my CARLA vehicles spawn but not move?▼

The most common cause is the spawning process exiting, which kills the Traffic Manager it created and leaves vehicles at throttle 0.00. Spawn with --hold to keep the TM alive, and ensure the world is synchronous with something ticking it.

Does this work without a CARLA source checkout or UE4?▼

Yes. It only needs the carla Python module importable by the active interpreter and a reachable, already-running CARLA server. UE4_ROOT and a source build are not required.

Why does the CARLA server appear hung after spawning traffic?▼

The world was likely left in synchronous mode with nothing ticking it, usually because a held process was killed with kill -9 instead of Ctrl+C so its settings restore never ran. Set synchronous_mode back to False from any client to recover.

How do I place vehicles in one lane at fixed spacing in CARLA?▼

Use the line subcommand with a starting point and gap, for example python3 scripts/vehicles.py line --at 30,20,0 --count 5 --gap 15. It snaps the point to the nearest driving lane and steps along it with the Waypoint API.