This repository builds a small CARLA C++ client against an already built CARLA source tree.
It uses the official CARLA Examples/CppClient build system. CARLA's documentation says that the C++ client example is located in CARLA_ROOT/Examples/CppClient, can be built with make on Linux, and can also be used outside the CARLA repository by editing the first location variables in the example Makefile.
You need a working CARLA source build first. The expected default layout is:
~/carla-build/carla
~/UnrealEngine_4.26
~/carla-python-venv
The default CARLA source path used by this repository is:
CARLA_ROOT=$HOME/carla-build/carlaOverride it when needed:
export CARLA_ROOT=/path/to/carlachmod +x scripts/*.sh
./scripts/status.sh
./scripts/build.shThe built binary will be generated here:
vendor/CppClient/bin/cpp_client
Start CARLA first in another terminal:
~/carla-build/launch-carla-clean.shThen run the C++ client:
./scripts/run.sh 127.0.0.1 2000 10Arguments:
./scripts/run.sh [host] [port] [timeout_seconds]
The client code is in:
src/main.cpp
The current client connects to the CARLA server, prints the current map and lists available maps.
CARLA's C++ client build is tightly coupled to the CARLA source tree and its generated Build dependencies. For that reason, this repository bootstraps from the official Examples/CppClient folder and patches the Makefile paths automatically.
git clone <your-repository-url> carla-cpp-client
cd carla-cpp-client
export CARLA_ROOT=$HOME/carla-build/carla
chmod +x scripts/*.sh
./scripts/build.sh
./scripts/run.sh