A Windows desktop control panel for the CARLA autonomous-driving simulator. Instead of scripting CARLA by hand, you spawn and drive vehicles, choreograph timed movements, draw and replay paths, steer the camera, change weather and time of day, and record video — all from a WinForms UI that drives CARLA's Python API underneath.
📷 Add a screenshot or a short GIF of the UI driving the simulator here — this app is highly visual and a clip sells it instantly.
Platform: Windows, .NET 8 (WinForms) front-end + Python 3.7 CARLA scripts.
- Actors: spawn vehicles/objects (with autopilot, freeze, and color options), list them, delete them, and read back their live coordinates.
- Movement: move an actor to a point at a chosen velocity, move many actors at once, follow an actor with the spectator camera, or schedule sequences of timed moves.
- Path drawing: draw vehicle paths into the world and replay recorded trajectories, with per-key color selection.
- World: change map, set weather presets, time of day, and wind; toggle map layers.
- Camera & video: move the spectator, record camera feeds, and convert recordings to MP4.
- Scenes: save the full scene (actors + spectator + drawings) to disk and reload it later.
CarlaControl is a two-process application: a C# front-end and a set of Python workers that hold the actual CARLA connection.
┌──────────────────────────┐ TCP localhost:9999 ┌───────────────────────────┐
│ CarlaControl (C# / WinForms) │ ──── text commands ────▶ │ carla_script.py --server │ ──▶ CARLA
│ │ ◀── <BEGIN_OUTPUT>…<END_OUTPUT> │ (persistent CARLA client) │ simulator
│ Managers / Services / Models │ └───────────────────────────┘
└──────────────────────────┘
│ also launches, per task:
├─ carla_drawing.py (path overlay, pygame)
├─ carla_recording.py (camera capture → frames)
├─ carla_vehiclepath.py (moving-path drawing)
└─ carla_videoconverter.py (frames → MP4 via ffmpeg)
PythonScriptServiceruns a persistent Python "server" and exchanges newline-free text commands (spawn_object,move_actor_to,set_weather, …) over a TCP socket, parsing results delimited by<BEGIN_OUTPUT>…<END_OUTPUT>. If the server can't be reached it falls back to a stateless mode, launching Python once per command — so the UI keeps working even without the persistent connection.ProcessManagerowns the auxiliary long-running processes (recording, drawing, follow-camera), with lifecycle tracking and cleanup.Managers/Services/Models/keep the concerns separated: coordinate math, scheduled-move sequencing, actor bookkeeping, file I/O, and the DTOs (de)serialized withSystem.Text.Json/Newtonsoft.Json.
The C# side never imports CARLA — it treats the Python workers as a small command server, which keeps the heavy simulator dependency entirely on the Python side.
| Script | Role |
|---|---|
carla_script.py |
The command server — spawns/controls actors, weather, scenes; everything the UI drives |
carla_drawing.py |
Interactive path/shape drawing overlay (pygame) |
carla_vehiclepath.py |
Renders moving vehicle paths |
carla_recording.py |
Captures camera feeds to a session folder |
carla_videoconverter.py |
Stitches captured frames into MP4 (ffmpeg) |
simple_vehicle_control.py |
Minimal manual driving script |
update_z_coordinates.py |
Utility to snap saved coordinates to the road surface |
- CARLA 0.9.x simulator running locally (default
localhost:2000). - Python 3.7+ with
carla,pygame, andnumpy(CARLA's PythonAPI matches the simulator version). - .NET 8 SDK (Windows).
- ffmpeg on
PATHfor the video-conversion step.
- Start CARLA (
CarlaUE4.exe) so it's listening onlocalhost:2000. - Prepare the Python workers.
Globals.csexpects them as executables underdist/…(built with PyInstaller, e.g.pyinstaller --onedir PythonApp/carla_script.py). To run from source instead, point the paths inCarlaControl/Models/Globals.csatpython PythonApp/<script>.py. - Build and run the C# app:
dotnet build -c Release dotnet run -c Release --project CarlaControl
- In the app, start the Python server, then spawn actors and drive the simulator from the UI.
CarlaControl/ C# WinForms front-end
Managers/ process + coordinate + scheduling logic
Services/ Python bridge + file I/O
Models/ DTOs, enums, and Globals (paths/config)
PythonApp/ the CARLA Python workers
- Built against CARLA 0.9.x; the command vocabulary lives in
carla_script.pyand mirrors the methods onPythonScriptService. - The build carries nullable-reference warnings typical of a large WinForms project; they are diagnostics, not defects.
- The CARLA PythonAPI itself is not vendored here — install it from your CARLA distribution so versions match.
MIT — see LICENSE.