This project implements Model Predictive Control (MPC) for quadrotor formation control, with specific focus on maintaining stability and performance even after rotor failure. The implementation utilizes the Acados framework for efficient real-time optimization.
- Python 3.7 or higher
- CMake
- C/C++ compiler
- Git
# Clone the repository and its submodules:
git clone https://github.com/acados/acados.git
cd acados
export ACADOS_SOURCE_DIR=`pwd`
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACADOS_SOURCE_DIR/lib
git submodule update --recursive --init
# Build and install Acados:
mkdir -p build
cd build
cmake -DACADOS_WITH_QPOASES=ON ..
make install -j4
# Install the Python interface:
cd $ACADOS_SOURCE_DIR
pip install -e interfaces/acados_template
pip install pyquaternion
main.py
: Driver code containing primary control functionsquadrotor.py
: Quadrotor dynamics implementationcontroller.py
: MPC solver interface and control computationutils.py
: Utility functions supporting core functionality
The project implements four primary control modes:
move2Goal(goal_coordinates)
- Navigates the quadrotor to specified target coordinates
- Parameters:
goal_coordinates
(x, y, z position)
stableHover(hover_coordinates)
- Achieves stable hovering at specified position
- Parameters:
hover_coordinates
(x, y, z position)
basicNavigation()
- Demonstrates trajectory tracking capabilities
- Handles complex paths with three-motor operation
- No parameters required
controlledLanding(initial_position)
- Executes controlled descent and landing
- Parameters:
initial_state
(all state variables)
To run the simulation, execute the main script and specify the function to execute. For move2Goal:
General Usage
python main.py <function_name>
Example Commands
- To run the move2Goal function:
python main.py move2Goal
- To run other functions, such as StableHover, BasicNavigation, or ControlledLanding:
python main.py StableHover
python main.py BasicNavigation
python main.py ControlledLanding
- Real-time MPC implementation using Acados
- Robust control under rotor failure conditions
- Multiple control modes for different scenarios
- Trajectory tracking with degraded actuator capabilities
- The
<acados_root>
path must be the absolute path from/home/
- Ensure all shared libraries (libacados.so, libblasfeo.so, libhpipm.so) are properly linked
- The system has been tested with three-motor operation for degraded performance scenarios