Skip to content

MPC pathtracking implementation with python, solved by PANOC/IPOPT

License

Notifications You must be signed in to change notification settings

MizuhoAOKI/pympc_panoc_ipopt

Repository files navigation

MPC implementation with Python, solved by PANOC/IPOPT

This repository provides samples of Model Predictive Controller(MPC) implementation with python.

The options of optimization solver is PANOC and IPOPT.

Just change "solver_type" in simulation_setting.yaml as you like.

What is IPOPT?

It is a famous solver for a nonlinear optimization problem. See IPOPT official page for detail.

What is OpEn?

It is a numerical optimization solver written in Rust. The algorythm is called PANOC(Proximal Averaged Newton-type method for Optimal Control).

Following features are highlighted.

  • Embeddable
  • Accurate
  • Fast
  • User Friendly
  • Community
  • Documented

See Official Page for detail.

Simulation Results

Simple Pathtrack with MPC, predicting vehicle behavior by Kinematic Bicycle Model.

SVG Animation

MPC log

Simulator log

Realtime visualizer

realtime_visualizer.mp4

Environment construction

Here are procedures for ubuntu users.

  • Install Python
    • pyenv is helpful to switch version of python interpreters.
    • Python version 3.8.x is recommended.
  • Install Poetry
    • $ curl -sSL https://install.python-poetry.org | python3 -
    • $ echo export PATH="/home/mizuho/.local/bin:$PATH" >> ~/.bashrc
  • Install cargo
    • $ sudo apt-get -y install cargo
  • Clone this repository
    • git clone https://github.com/MizuhoAOKI/pympc_panoc_ipopt.git
  • Install python libraries
    • $ cd pympc_panoc_ipopt
    • $ poetry install

How to run

$ cd pympc_panoc_ipopt
$ poetry shell
$ cd pathtrack
$ python main.py

References