First Simulation
Run v2xp_datadump_town06_carla in CARLA Town06. Complete Installation
first. This example uses CARLA and core OpenCDA. SUMO, Artery, and learned
cooperative perception are optional additions in the later guides.
Create the Containers
Run in Linux Bash or Ubuntu in WSL2, from the CAVISE root:
./run.sh build carla opencda-minimal
./run.sh up carla opencda-minimal
CARLA runs on Windows, so build only OpenCDA here:
./run.sh build opencda-minimal
./run.sh up opencda-minimal
Check that the container is running and can access the GPU:
docker ps
docker exec opencda nvidia-smi
up creates containers that wait with sleep infinity. Start CARLA and
the scenario explicitly in separate terminals below.
Start CARLA
Keep this terminal open while the scenario runs.
In Linux Bash:
docker exec -it carla bash
./CarlaUE4.sh -quality-level=Low
For off-screen rendering, use ./CarlaUE4.sh -RenderOffScreen instead.
In Windows PowerShell, change to the extracted CARLA directory
containing CarlaUE4.exe, then run:
.\CarlaUE4.exe -quality-level=Low
For off-screen rendering, use .\CarlaUE4.exe -RenderOffScreen instead.
Connect from OpenCDA
In a new Linux/WSL terminal, enter the OpenCDA container:
docker exec -it opencda bash
The shell starts in the mounted OpenCDA repository. Set the CARLA address inside this container shell:
export CARLA_HOST=carla
export CARLA_HOST=host.docker.internal
This address is provided by Docker Desktop. A Docker Engine installed independently inside WSL may require a different Windows host address. See Troubleshooting.
All subsequent guides use --carla-host "$CARLA_HOST". Repeat this export
whenever you open a new container shell. CARLA_HOST is a shell variable
used by these examples. The runner does not read it automatically.
Before launching, query both API versions and the available Town06 map:
python - <<'PYTHON'
import os
import carla
client = carla.Client(os.environ["CARLA_HOST"], 2000)
client.set_timeout(30.0)
print("Client:", client.get_client_version())
print("Server:", client.get_server_version())
print("Town06:", [m for m in client.get_available_maps() if m.endswith("/Town06")])
PYTHON
Both versions should match and Town06 should be listed. Resolve a connection or map error before continuing.
Run the Scenario
In the same OpenCDA container shell:
python opencda.py -t v2xp_datadump_town06_carla \
--carla-host "$CARLA_HOST" --ticks 200
OpenCDA loads opencda/scenario_testing/config_yaml/v2xp_datadump_town06_carla.yaml over
default.yaml, initializes Town06, creates the configured agents, and
advances the simulation. --ticks bounds the run. It may end sooner if its
scenario completion conditions are met. Logs and evaluation output are under
simulation_output/evaluation_outputs/ in the mounted OpenCDA repository.
Use --free-spectator to keep manual control of the CARLA camera. See
Recording and Results for recording, visualization, and output files.
Stop and Run Again
Let the bounded run finish, or press Ctrl+C in the OpenCDA terminal.
Stop CARLA with Ctrl+C in its terminal when no longer needed.
To stop the containers, run from the CAVISE root on Linux/WSL:
./run.sh stop carla opencda-minimal
./run.sh stop opencda-minimal
Use run.sh start with the same services to restart existing containers,
then launch the simulator processes again. Use up after rebuilding or
changing an image target. start does not recreate a container.