control-traffic-lights

Controls CARLA traffic-light actors to set states, freeze phases, and adjust timing.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually scripting CARLA traffic-light behavior requires knowing the Python API details for states, freezing, and phase timing, and mistakes like editing a cycling light lead to confusing results. This Skill provides tested commands to set, freeze, retime, and reset traffic lights on a running CARLA server. ## Core Features & Use Cases - State Control: Set lights green, red, yellow, or off — targeting all lights, one by id, all in a junction, or the nearest to a coordinate. - Freeze and Timing: Freeze all lights (optionally forcing all-green for free-flow tests) and tune green/yellow/red phase durations. - Use Case: A user testing autonomous vehicle behavior says "make all the lights green so cars don't stop" — the Skill runs freeze on --state green to hold every light green until reset. ## Quick Start Ask the AI to make all traffic lights green so vehicles flow freely, or to set a specific junction's light to red.

Frequently Asked Questions about control-traffic-lights

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

FAQPage Schema
How do I make all traffic lights green in CARLA?▼

Run the freeze command with the green state: `traffic_lights.py freeze on --state green`. This forces every light to green and holds it there until you run `freeze off` or `reset` to resume normal cycling.

How to set a traffic light red at one junction in CARLA?▼

Use `set --state red --junction <id>`, where the junction id comes from the map-waypoints skill's junctions listing. You can also target a single light by actor id or the nearest light to a coordinate with `--near X,Y,Z`.

Does this control the CARLA Traffic Manager?▼

No, this controls the actual traffic.traffic_light actors, not the Traffic Manager. The Traffic Manager (handled by the control-traffic skill) governs how autopilot vehicles behave, including whether they ignore lights.

Why do CARLA traffic lights snap back after I set them?▼

The `set` command only changes the current state while the light keeps cycling through its phases. To hold a state indefinitely, use `freeze on`, or change the cycle itself with the `timing` command.

What are the prerequisites for controlling CARLA traffic lights?▼

You need the carla Python module importable in the active interpreter and a reachable, already-running CARLA server (default 127.0.0.1:2000). UE4_ROOT and a source checkout are not required; run check_env.sh to verify.