Installing or adding MPPI-Generic to your project
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:
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.
submodules/MPPI-Generic folder in your desired project.
    cd /path/to/project-root
mkdir -p submodules
git submodule add https://github.com/ACDSLab/MPPI-Generic.git submodules/MPPI-Generic
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)
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)
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 -DMPPI_BUILD_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
From the root directory of the MPPI-Generic repo:
mkdir -p build && cd build
cmake -DMPPI_BUILD_TESTS=ON .. # configure cmake to build tests
make
You can then run the unit tests with:
make test