Aller au contenu
Skillpedia
Tests15k · #11103

spawn-walkers

Ce qu’il fait

Cette compétence ajoute des piétons à une simulation CARLA pour rendre la scène urbaine plus vivante. Elle s'adresse aux personnes qui testent des voitures autonomes et ont besoin de piétons à éviter.

Quand l’utiliser

  • ✓Quand vous voulez une foule de personnes qui marchent dans les rues simulées.
  • ✓Quand vous avez besoin de piétons présents pour tester la réaction d'une voiture face à des personnes sur la route.
  • ✓Quand vous voulez retirer les personnes pour que la rue soit de nouveau vide.

Lien du skill

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/spawn-walkers/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/spawn-walkers/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Peux-tu mettre 30 personnes qui marchent dans ma ville CARLA et faire en sorte qu'elles continuent de marcher pendant mon test ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent place chaque piéton sur les zones praticables de la carte et lui attribue un lieu aléatoire où aller. Les piétons choisissent sans cesse de nouveaux lieux, et une session maintenue les garde en mouvement.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Spawn wandering pedestrians

Paths. scripts/… and references/… 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 map with pedestrians that walk around on their own. Each is a walker.pedestrian.* body paired with a controller.ai.walker that steers it to random points on the navigation mesh. The deliverable is a live, moving crowd; destroy tears it down cleanly.

By default they wander indefinitely: on spawn every controller is start()ed, given one random navmesh destination, and a random walking speed. That single target is enough — CARLA's walker AI automatically picks a fresh random destination each time a walker arrives (confirmed in LibCarla's nav code), so the crowd roams forever with no re-targeting loop. Pass --no-wander for a stationary crowd (controllers left unstarted).

This needs a navmesh — validate it first with the debug-navmesh skill if walkers won't move.

The controllers stop when the client that started them exits. Same rule as the Traffic Manager, and it is the reason a fire-and-forget spawn leaves the crowd standing still. Pass --hold: the process stays alive and the crowd keeps walking.

It is not primarily about pumping ticks, which is what this skill used to say. The two were confounded, because --hold both keeps the client alive and pumps. Separating them needed a second client owning a synchronous clock; measured on 0.10.0, walkers spawned against a world ticked by a traffic client:

setup result
spawn, process exits (another client ticking) 0/15 move
a separate client issues start() and stays alive 15/15 move, then stop when it exits
spawn --hold, observing only, never ticking 10/10 move, 9.94 m in 8 s

The first row has a second symptom worth knowing: a later start() on those controllers is accepted rather than rejected as already-started, which proves the original call never landed. _ensure_walking therefore verifies by displacement and re-issues (--retries) instead of trusting start().

Ticks still have to come from somewhere, of course — that is the clock rule below, not the walkers' own business.

The clock rule

Read the world settings before doing anything:

  • already synchronous — another client owns the clock. Never call tick(); observe with wait_for_tick(). Ticking a world you do not own is what silently drops commands like start().
  • asynchronous — this client may switch it to sync (--delta, default 20 Hz) and become the ticker. --no-sync opts out.

Either way the previous settings are restored on release: a synchronous world with nothing ticking does not advance at all, and is indistinguishable from a hung server. So stop a holder with Ctrl+C (SIGINT), never kill -9 — the restore runs in a finally.

Walkers are also spawned --z-offset (default 2.0 m) above the navmesh point: spawning at the navmesh z is rejected on 0.10.0 with "Spawn failed because of collision at spawn position" (+0.5 still fails, +1.0 is the first that works).

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: (if walkers won't move) validate the navmesh — debug-navmesh
- [ ] Step 3: Spawn N walkers with --hold (the controllers die with the client)
- [ ] Step 4: Verify visually / via the world-data skill; spawn reports its count
- [ ] Step 5: Ctrl+C the held process, then destroy (controllers first, then walkers)

Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh.

Step 1: Check prerequisites

bash scripts/check_env.sh

Step 3-5: Spawn / roam / destroy

source scripts/env.sh

# 30 pedestrians wandering at 1.0-1.8 m/s — --hold keeps this client alive, and
# the controllers stop the moment it exits
python3 scripts/walkers.py spawn --count 30 --hold

# reproducible placement (still wanders forever)
python3 scripts/walkers.py spawn --count 50 --seed 42

# more road-crossing, faster walkers
python3 scripts/walkers.py spawn --count 20 --cross-factor 0.4 --speed-min 1.4 --speed-max 2.2

# a stationary crowd (no autonomous movement)
python3 scripts/walkers.py spawn --count 20 --no-wander

python3 scripts/walkers.py destroy        # correct-order teardown

Verify

The spawn comma

Questions fréquentes

Les piétons continueront-ils à marcher après la fin du programme ?

Non. Les marcheurs s'arrêtent lorsque le programme qui les a lancés se termine, et la compétence peut donc garder la session ouverte.

La carte nécessite-t-elle une configuration particulière ?

Oui. La carte doit avoir une zone de marche, et la compétence peut la vérifier en premier si les marcheurs ne bougent pas.

La foule peut-elle rester immobile à la place ?

Oui. Une foule immobile est disponible en désactivant la marche.

Détails

Description originale de l’auteur

Spawns pedestrians that wander autonomously via WalkerAIController, and destroys them in the correct order. Pairs each walker.pedestrian.* with a controller.ai.walker, places them on the navigation mesh, and sends them to random navmesh points at walking speed. Use when the user asks to "spawn pedestrians/walkers", "add people/crowds", "make pedestrians walk around", or "remove the walkers". Reads the world settings first: if the world is already synchronous it never ticks it, and if it is asynchronous it makes it synchronous and drives the clock itself.

repo: carla-simulator/carla

Popularité

Étoiles GitHub
15k
Position au classement
#11103
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires