bcbarbara / crazyflie_nmpc

ROS stack with an efficient real-time NMPC for the Crazyflie 2.1
Other
95 stars 31 forks source link
acados blasfeo control crazyflie hpipm nmpc optimization ros-kinetic

crazyflie_nmpc

featured

ROS stack containing an efficient real-time NMPC for the Crazyflie and with the following features:

Citing this work

License: MIT

If you use this project, give us the credit by citing this work:

@inproceedings{barroscarlos2020,
  author      = {Carlos, B\'arbara Barros and
                 Sartor, Tommaso and
                 Zanelli, Andrea and
                 Frison, Gianluca and
                 Burgard, Wolfram and
                 Diehl, Moritz and
                 Oriolo, Giuseppe},
  title       = {An Efficient Real-Time {NMPC} for Quadrotor Position Control under Communication Time-Delay},
  booktitle   = {16th International Conference on Control, Automation, Robotics and Vision (ICARCV)},
  pages       = {982--989},
  year        = {2020}
}

The paper can be found here, while the arxiv file is available here.

Watch our YouTube video showing the experiments:

video

Installation

Check the wiki for more information, including the installation instructions for ROS Kinetic.

Packages

There are seven packages in this stack: acados, crazyflie_cpp, crazyflie_driver, crazyflie_tools, crazyflie_description, crazyflie_controller, and crazyflie_demo.

acados

A submodule with fast and embedded solvers for nonlinear optimal control.

crazyflie_cpp

This submodule contains a cpp library for the Crazyradio and the Crazyflie. It can be used independently of ROS. It supports the logging subsystem for streaming data in real-time and the parameter subsystem for adjusting parameters.

crazyflie_driver

It contains a ROS wrapper around crazyflie_cpp. The logging and parameter subsystems are mapped into ROS messages and ROS parameters respectively.

crazyflie_tools

This package is capable of:

crazyflie_description

This package contains a 3D model of the Crazyflie 1.0 for visualization purposes in rviz.

crazyflie_controller

This package contains an efficient and modular implementation of a nonlinear model predictive controller (NMPC) tailored to the Crazyflie with time-delay compensation. The NMPC is implementend using the high-performance software package acados, which solves optimal control problems and implements a real-time iteration (RTI) variant of a sequential quadratic programming (SQP) scheme with Gauss-Newton Hessian approximation. The quadratic subproblems (QP) arising in the SQP scheme are solved with HPIPM, an interior-point method solver, built on top of the linear algebra library BLASFEO, finely tuned for multiple CPU architectures. We use a recently proposed Hessian condesing algorithm, particularly suitable for partial condensing, to further speed up solution times.

The package also contains a PID controller for waypoint navigation developed by Wolfgang Honig.

Both implementations rely on the knownledge of the global position of the Crazyflie (e.g., though a motion capture system).

crazyflie_demo

Contains sample scripts and launch files for teleoperation, hovering, and waypoint navigation for both single and multi Crazyflie cases.

For more detailed information about each package, we refer to the crazyflie_ros stack documentation.

ROS Features

Parameters

The launch file supports the following arguments:

See how to obtain good trim values here.

Subscribers

cmd_vel

The following fields are used:

Note See how to tune these parameters for your joystick in crazyflie_controller/launch/logitech.launch

Publishers

euler_angles

motor_speeds

imu