My modifications to the examples from CARLA 0.9.13 PythonAPI.
You can change --gpus 0
to --gpus all
or ---gpus <some_number>
if you have more than one GPU.
docker run --rm -it --name carla-container -u carla -p 2000-2002:2000-2002 --gpus 0 ricardodeazambuja/carlasim:0.9.13_headless ./launch_headless.sh
Press ENTER to kill the simulator (it takes some seconds until it dies...).
Using the PythonAPI
docker cp carla-container:/home/carla/PythonAPI .
conda create --name carla-simulator python=3.7
conda activate carla-simulator
pip install --upgrade pip
cd PythonAPI/examples/
pip install -r requirements.txt
cd ../carla/dist/ #it's inside PythonAPI/carla/dist
pip install carla-0.9.13-cp37-cp37m-manylinux_2_27_x86_64.whl
If pip complains and you are sure the Python version is correct, one possible cause is that you forgot to upgrade pip
python generate_traffic.py
It should print spawned 30 vehicles and 10 walkers, press Ctrl+C to exit.
Open a new terminal (don't forget to run conda activate carla-simulator
) the and type:
python synchronous_mode.py
It should open a pygame display with a random vehicle moving through the town (with the focus on the pygame display, press ESC to exit).