![]() |
VSM C++ SDK
Vehicle Specific Modules SDK
|
C++ VSM SDK for Universal ground Control Software.
C++ VSM SDK is implemented using C++ language (C++14 standard) which is also a requirement for SDK users code.
VSM SDK uses CMake as its build system to keep it platform independent.
Essentially what CMake does is it wraps the platform specific build commands/files under common interface. Out-of-source builds are supported and recommended.
Currently supported build toolchains/compilers and their respective versions are:
Windows:
Linux:
Mac:
Below are instructions on how to prepare build environment on Windows and Ubuntu Linux.
After the required components are installed the workflow is identical on all platforms.
Protobuf library must be either built from source or installed as precompiled package.
See https://github.com/protocolbuffers/protobuf for details.
Download and install the latest MinGW-w64 from http://sourceforge.net/projects/mingw-w64.
Use MinGW installer. When it asks for configuration you should input:
Make sure mingw bin directory is added to PATH (E.g. C:\mingw\mingw64\bin)
Get the latest cmake from http://www.cmake.org.
Make sure cmake is added to PATH (E.g. C:\Program Files (x86)\CMake\bin)
Get the latest Python 2.7 from http://www.python.org/download/
Make sure python is added to PATH (E.g. C:\Python27)
Ubuntu 16.04+ has all the required packages in default repositories.
# apt install gcc g++ cmake python2.7 libprotobuf-dev
Your should use install latest XCode. After that you can run CMake in the same way as on other platforms.
Eclipse is recommended IDE for all platforms.
You should have the latest Java for eclipse to run.
Some plugins are recommended for the development of VSM SDK itself. They are not required for standalone VSM development.
CMake editor plugin: http://sourceforge.net/projects/cmakeed/
UML diagram plugin: http://plantuml.sourceforge.net/eclipse.html
The vsm-cpp-sdk directory includes eclipse project file which is tuned for underlying build system. To use it go to "File/Import/Existing Projects into Workspace" Eclipse project features:
Lastly under Project/Properties/C++General/Preprocessor Includes/Providers: Check the "CDT GCC built in compiler settings" checkbox.
OEM manufacturers and enthusiasts are supposed to compile the SDK by themselves so source code is provided for them (https://github.com/UgCS/vsm-cpp-sdk), however they are not supposed to modify the SDK sources. If some functionality is missing, it is always worth to contact UgCS and suggest a proposal. Good proposals have a chance to be officially added to the SDK, so everybody can benefit from it.
CMAKE (http://www.cmake.org/) cross-platform build system is used by VSM C++ SDK. You can use standard CMake variables to change the build process:
Python 2.6 (or later from branch 2.x) is needed for make file generation.
Assume you are working from your $HOME directory:
1) Clone the SDK repository:
git clone git@github.com:UgCS/vsm-cpp-sdk.git
2) Make and enter into build directory:
mkdir -p build/vsm-sdk cd build/vsm-sdk
3) Create make files:
cmake -DUGCS_INSTALL_DIR=~/install/ -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles" ~/vsm-cpp-sdk
4) Launch the build:
cmake --build . -- install If build suceeds you'll have VSM SDK installed in directory $HOME/install/opt/vsm-sdk
Proceed to VSM build instructions
Assume you are working from your $HOME directory:
1) Clone the Ardupilot and common repositories:
Ardupilot VSM requires vsm-cpp-common repository which includes MAVLINK frameworks which is shared among all VSMs which support MAVLINK protocol. git clone git@github.com:UgCS/vsm-cpp-common.git git clone git@github.com:UgCS/vsm-cpp-ardupilot.git
2) Make and enter into build directory:
mkdir -p build/vsm-ardupilot cd build/vsm-ardupilot
3) Create make files:
cmake -DVSM_SDK_DIR=$HOME/install/opt/vsm-sdk -DCOMMON_SOURCES=$HOME/vsm-cpp-common -G"Unix Makefiles" $HOME/vsm-cpp-ardupilot
4) Launch the build:
cmake --build . If build suceeds you'll have vsm-ardupilot executable in current directory.
Additional variables should be defined either as environemnt variables or as cmake "defines" via -D option.
PROTOBUF_SOURCE_ROOT should point to protobuf source. This is needed because protobuf library for android is built form sources.
cmake -DANDROID=1 -DANDROID_NDK=/opt/android-ndk-r18b -DPROTOBUF_SOURCE_ROOT=/git/protobuf ..
VSM SDK should be installed after compilation as usually. Android native libraries are available in build directory under "android/libs" path after the VSM is built.
Additional CMake and environment variables are accepted for Android build: