Skip to content

A Model Predictive Control based local planner (controller) for differential drive vehicles. See surajRathi/mpc_local_planner for ROS integration.

Notifications You must be signed in to change notification settings

surajRathi/mpc_lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpc_lib

Uses Model Predictive Control for path planning of a differential drive vehicle. Uses IPOPT to solve the non-linear optimization problem. Intended to be used with surajRathi/mpc_local_planner as a local planner for the ROS Nav Stack.

Forked from project-TARIV/mpc_lib to add documentation.

Dependencties

  • cmake: Build System

  • catkin OPTIONAL
    Project is made to be compiled with catkin for the ROS framework, but does work with just cmake.

  • cppad For Ubuntu:

sudo apt-get install cppad
  • Ipopt This installs it to /usr/local. You can edit the install_ipopt.sh before execution to modify that For Ubuntu:
sudo apt-get install gfortran
sudo apt-get install unzip
wget 'https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.7.zip'
unzip Ipopt-3.12.7.zip
rm Ipopt-3.12.7.zip
sudo bash install_ipopt.sh ./Ipopt-3.12.7/

Working

We solve an optimisation problem for acceleration in each wheel.

  1. A simple kinematic model has been selected where $v_r$ and $v_l$ are velocities of each wheel, $a_r$ and $a_l$ are the respective accelerations, and $L$ is the wheelbase.

    • $x_i = x_{i-1} + \frac{v_r + v_l}{2} * cos(\theta_{i-1}) * dt$
    • $y_i = y_{i-1} + \frac{v_r + v_l}{2} * sin(\theta_{i-1}) * dt$
    • $\theta_i = \theta_{i-1} + \frac{v_r - v_l}{L} * dt$
  2. Constraints: We enforce maximum and minimum constraints on each wheel's velocity.

  3. Objective Function: This is of the form $\sum{w_i*(\text{cost}_i)^2}$. The factors, $\text{cost}_i$ are listed below. We must choose appropriate weights, $w_i$ for each of them. The path to follow has been defined as a polynomial $f(x)$.

    • $v_r + v_l - 2 * v_{ref}$
    • $v_r - v_l$
    • $a_r + a_l$
    • $a_r - a_l$
    • $f(x) - y$

References

About

A Model Predictive Control based local planner (controller) for differential drive vehicles. See surajRathi/mpc_local_planner for ROS integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 86.5%
  • CMake 9.3%
  • Shell 4.2%