Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time



  1. Clone this repo in the src directory of your catkin workspace.

    ~/catkin_ws/src$ git clone --recursive
  2. Install some system dependenices

    sudo apt-get install libyaml-cpp-dev libglfw3-dev`
  3. Install ROS dependencies. We manage them with rosdep. In the root of you catkin workspace do:

    ~/catkin_ws$ rosdep init
    ~/catkin_ws$ rosdep install --from-paths src/sampling_based_control --ignore-src -y
  4. Finally, the manipulation example requires the installation of the raisim simulator. Visit its README and follow the described procedure.


For improved performance, make sure to change the build type and then build all packages.

~/catkin_ws$ config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
~/catkin_ws$ build


The mppi_examples folder contains a set of examples that show how to use the control suite. In general each example needs to implement the following functions and classes:

  • a stage cost: a function that maps the current state and input to a scalar cost value. You can find a simple implementation of the cost class for a first order mass here. Cost classes must inherit from the cost base class
  • system dynamics: given the currently stored state and applied input predict the next state. You can find a simple implementation of the cost class for a first order mass here. Dynamics classes must inherit from the cost base class
  • controller interface: finally cost and dynamics can be used in a stochastic controller which uses a gaussian policy to control the system. The mppi_ros provides some utilities classes to simplify the task. Generally, a controller interface istanciate a cost, dynamics (previously defined), a policy (only Gaussian currently supported) and build a solver class. You can find an example here.

In each example, the system dynamics is used also outside the controller as "a simulator" of the system which is controlled. This is a good check, as the model (dynamics in the controller) exactly matches the controlled system (dynamics receiving the input from the controller). See this for an example.