Giter Site home page Giter Site logo

quadrotor_lqr's Introduction

Linear controller for quadrotor

Code in this repo was developed based on https://github.com/juanmed/quadrotor_sim/blob/master/3D_Quadrotor/3D_control_with_body_drag.py.

The dynamics decribed in Eq. (2.22) from this thesis was adopted. In order to make use of LQR, the nonlinear dynamics is first linearized around the equilibrium (phi = 0 and theta = 0). We refer the interested readers to this paper for details about linearization. Then, LQR is used to calculate a linear controller. The linear controller is then plugged in. The resulting closed-loop linear and nonlinear systems are evaluated either to follow some waypoints or to track a randomly generated trajectory. Finally, the realized trajectories and tracking error for both systems are plotted.

Requirements

pip install scipy matplotlib

Usage

# follow waypoints (-w x1 y1 z1 -w x2 y2 z2 -w x3 y3 z3 -w ... -T total simulation time). The quadrotor starts from the origin.
python 3D_quadrotor.py -T 20 -w 1 1 1 -w 1 1 2 -w 0 0 0
# track a randomly genearted trajectory
python 3D_quadrotor.py --seed 0

Follow waypoints

quadrotor_lqr's People

Contributors

sundw2014 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.