Model Predictive Control for an Autonomous Vehicle
We utilize model predictive control to perform lane following and obstacle avoidance.
Agent trying to avoid obstacles.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Python 3.6.10
do-mpc 4.1.1
numpy >= 1.16.2
matplotlib >= 3.1.1
.
├── src
│ ├── main.py # Execution part
│ ├── MPC.py # the algorithm of model predictive control
│ ├── model.py # simple bicycle model
│ ├── globals.py # some variables that use globally
│ ├── maps.py # generate a usable map from any picture (cited from matssteinweg)
│ └── reference_path.py # generate reference path, waypoints for the assigned map (cited from matssteinweg)
├── result # GIF files of the results of two scenarios
├── maps # the picture of the map
└── README.md
There are 2 tasks you can try, which are lane following and obstacle avoidance, as shown in Results section
Modify the flag at line 95 in the main.py
file if you want to switch between tasks
use_obstacles = False
after that, just run
python main.py
Agent trying to follow desired trajectory.