ROS 2 package implementing a Model Predictive Control (MPC) system for precise and real-time control of the Crazyflie 2.1 quadcopter.
The official Crazyswarm2 package had not implemented everything needed for my simulation purposes. Therefore, this controller is built against my own fork of the Crazyswarm2 package, which can be found here.
-
Clone the repository into your ROS 2 workspace.
-
Install the required dependencies:
python -m pip install casadi
python -m pip install numpy
python -m pip install osqp
rosdep install --from-paths src --ignore-src -r -y
- Build the package:
colcon build --symlink-install
Start the Crazyflie 2.1 simulation:
ros2 launch crazyflie launch.py backend:=sim
Start the MPC controller:
source install/setup.bash
ros2 launch crazyflie_mpc spiral_example.launch.py