Skip to content

Nonlinear Model Predictive Control (NMPC) for drones using acados, with MATLAB visualization.

License

Notifications You must be signed in to change notification settings

KafuuChikai/drone_mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drone_mpc

Nonlinear Model Predictive Control (NMPC) for Drone. This implementation is based on acados and inspired by A Comparative Study of Nonlinear MPC and Differential-Flatness-Based Control for Quadrotor Agile Flight. The visualization is done using MATLAB as shown below:

1. Installation

  1. Install acados and its dependencies, refer to the acados official documentation.

  2. Clone this repository:

    git clone https://github.com/KafuuChikai/drone_mpc.git
    cd drone_mpc

2. Directory Structure

  • drone_opt.py: Contains the implementation of the drone optimizer.
  • drone_model.py: Contains the definition of the drone model.

3. Usage

Run the optimizer:

python drone_opt.py

After running drone_opt.py, the drone state and control data files drone_state.csv and drone_control.csv will be generated.

4. Visualization

  1. Use the MATLAB script /data_test/data_show.m for visualization.

  2. First, import the position state from drone_state.csv as a variable p (shape time_step x 3).

  3. Then, run data_show.m in MATLAB to visualize the results.

About

Nonlinear Model Predictive Control (NMPC) for drones using acados, with MATLAB visualization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published