title | permalink | description | layout |
---|---|---|---|
Setup |
/setup |
Installing or adding MPPI-Generic to your project |
page |
On this page, we will try to give you a quick run-down on how to run MPPI-Generic on your own system.
MPPI-Generic relies on the following:
- An NVIDIA GPU
- GCC/G++
- CUDA 10 or newer (CUDA 11.7+ is recommended but our library is compatible back to CUDA 10)
- Eigen
- CMake 3.10 or newer
- git and git-lfs
- yaml-cpp
- python-pil
-
Follow the instructions to install CUDA provided here.
-
Install all the other prerequisites through
apt-get
:
sudo apt-get install libeigen3-dev libyaml-cpp-dev git git-lfs cmake gcc
git lfs install
# extra installs if you are wanting to build unit tests
sudo apt-get install libyaml-cpp-dev python3-pil
As MPPI-Generic is still developing its API, our recommended way to incorporate this library into your projects
is through git submodule
.
Git submodules allow you to keep track of specific commits of other projects so you can ensure that your code
will not break when the API is updated.
Setting up a git submodule
is rather straightforward.
- The following adds the MPPI-Generic codebase under a
submodules/MPPI-Generic
folder in your desired project.
cd /path/to/project-root
mkdir -p submodules
git submodule add https://github.gatech.edu/ACDS/MPPI-Generic.git submodules/MPPI-Generic
- We now modify the root
CMakeLists.txt
of your project to add MPPI-Generic as a library your code can link to. Note that this is a header-only library written in CUDA, so your executables/libraries will need to be*.cu
files for the correct compiler to be used. First, we will modify the languages your CMake project uses to add C++/CUDA support.
project(YOUR_PROJECT_NAME LANGUAGES CXX CUDA)
- Next, we add our CMake module configuration that sets up compilation flags such as which NVIDIA GPU architecture to compile for. After that, we add MPPI-Generic as a subdirectory and it is now ready for use.
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/submodules/MPPI-Generic")
include(MPPIGenericToolsConfig)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/submodules/MPPI-Generic)
- Adding MPPI-Generic to your target in CMake just requires linking to the
MPPI::MPPI
template library.
add_executable(test_executable test.cu)
target_link_libraries(test_executable MPPI::MPPI)
If you want to use MPPI-Generic as a stand-alone library, we recommend cloning the git repo:
git clone https://github.com/ACDSLab/MPPI-Generic.git
cd MPPI-Generic
git submodule update --init --recursive
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
make && make install
You now have the MPPI-Generic library!
From the root directory of the MPPI-Generic repo:
mkdir -p build && cd build
cmake -DBUILD_EXAMPLES=ON .. # configure cmake to build examples
make
cd examples
In the examples
folder, you will find multiple example programs using MPPI that should run such as cartpole_example
.
./cartpole_example