90284dc91e
Build success Added package Remove delete workspace for testing Clean workspace after build Add deploy for testing Relocation of Unreal Engine Using absolute path for UnrealEngine Execute shell Test without remove at end Using bash instead of shell New jenkins file for testing nodes new tag modified modify 'test' stage all in GPU tags all in 'build' and 'gpu' Adjust some scripts to run smooth on GPU slave force deploy always Disable docker push Remove all on slaves at end add some locks add some parallel stages Fix windows package, now it copies all required files Add 7zip option to compress package for windows Add 'make CarlaUE4Editor' to windows Fix the program files path for windows 64 More jobs on parallel Add Update.bat to windows pipeline Fixing make CarlaUE4Editor Commenting stages in windows Enable again download of content and fix artifact Build only Ubuntu Enable deploy of Docker Make packaging of additional maps Enabling windows build again Adding Deploy for windows Change URL to the new S3 buckets Changed the Jenkins public IP Fixes from Codacy Disable Windows build Add more time to smoke tests for connecting Add 'run' option of examples without compilation Enabled delete all after job Adds a lock for the packaging Removing all locks Update the Doxygen step in Ubuntu Fix nodes to use |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
README.md | ||
main.cpp |
README.md
C++ Client Example
This example creates an application using CARLA's C++ API to connect and control the simulator from C++.
Compile and run
Use the Makefile provided (Linux only), to compile and run the example. Note that it expects to have a simulator running at port 2000.
make run
How it works
In order to link our application against LibCarla, we need to compile LibCarla with the same compiler and configuration we are using with our application. To do so, we generate a CMake tool-chain file specifying the compiler and flags we want
# Example ToolChain.cmake
set(CMAKE_C_COMPILER /usr/bin/clang-7)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-7)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O3 -DNDEBUG" CACHE STRING "" FORCE)
We pass this file to CMake when compiling LibCarla.client
cd /path/to/carla-root-folder
make setup
cd /path/to/build-folder
cmake \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Client \
-DLIBCARLA_BUILD_RELEASE=ON \
-DLIBCARLA_BUILD_DEBUG=OFF \
-DLIBCARLA_BUILD_TEST=OFF \
-DCMAKE_TOOLCHAIN_FILE=/path/to/ToolChain.cmake \
-DCMAKE_INSTALL_PREFIX=/path/to/install-folder \
/path/to/carla-root-folder
ninja
ninja install
This will generate the following structure at the provided install path
libcarla-install/
├── include/
│ ├── carla/
│ ├── boost/
│ ├── rpc/
│ └── ...
└── lib/
├── libcarla_client.a
├── librpc.a
├── libboost_filesystem.a
└── ...
Our application needs to be linked at minimum against libcarla_client.a
and
librpc.a
. If we make use of IO functionality and/or image processing we would
need to link against boost_filesystem
, png
, tiff
, and/or jpeg
.
For more details take a look at the Makefile provided.