Coder Social home page Coder Social logo

orca-bit / crazyflie_nmpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcbarbara/crazyflie_nmpc

0.0 0.0 0.0 3.36 MB

ROS stack with an efficient real-time NMPC for the Crazyflie 2.1

License: Other

CMake 9.69% Python 28.28% C++ 61.23% Shell 0.80%

crazyflie_nmpc's Introduction

crazyflie_nmpc

featured

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

  • Support for the Crazyflie 2.1
  • Compatible with ROS Kinetic
  • NMPC controller for regulation and trajectory tracking (if motion capture system is available)
  • Publishes the onboard sensors data and the controller variables in ROS standard message formats

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:

  • Finding any Crazyflie in range
  • Listing the available logging variables and parameters

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:

  • uri: Specifier for the crazyflie (e.g., radio://0/80/2M)
  • tf_prefix: tf prefix for the crazyflie frame
  • roll_trim: Trim in degrees (e.g., negative if the Crazyflie drifts to the left)
  • pitch_trim: Trim in degrees (e.g., negative if the Crazyflie drifts forward)

See how to obtain good trim values here.

Subscribers

cmd_vel

The following fields are used:

  • linear.y: roll (e.g., -30 to 30 degrees)
  • linear.x: pitch (e.g., -30 to 30 degrees)
  • angular.z: yawrate (e.g., -200 to 200 degrees/second)
  • linear.z: thrust (10000 to 60000 -- mapped to PWM output)

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

Publishers

euler_angles

  • geometry_msgs/Vector3Stamped
  • contains the euler angles from the onboard stabilizer
  • update: 10 ms (time between Crazyflie and ROS not synchronized!)

motor_speeds

  • crazyflie_driver/GenericLogData
  • contains the individual motor speeds (PWM value)
  • update: 10 ms (time between Crazyflie and ROS not synchronized!)

imu

  • sensor_msgs/IMU
  • contains the sensor readings of gyroscope and accelerometer
  • update: 10 ms (time between Crazyflie and ROS not synchronized!)
  • can be viewed in rviz

crazyflie_nmpc's People

Contributors

ataffanel avatar bcbarbara avatar ernestum avatar jgsuw avatar jpreiss avatar lkumar93 avatar mikehamer avatar robotpilot avatar spohorec avatar tmmsartor avatar vibashan avatar whoenig avatar yotamgani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.