Giter VIP home page Giter VIP logo

hackflight's Introduction

Intro

Hackflight is a C++ software toolkit for building multirotor flight controllers. It is geared toward people like me who want to tinker with flight-control firmware, and use it to teach students about ideas like inertial measurement and PID tuning. If you are in the 99% percent of users who just want to get your vehicle flying without getting into firmware hacking, I recommend Betaflight (great for getting started when you're on a budget, and the origin of much of the code in Hackflight) or the Ardupilot system (for sophisticated mission planning with waypoint navigation and the like). In addition to big user communities and loads of great features, these platforms have safety mechanisms that Hackflight lacks, which will help avoid injury to you and damage to your vehicle.

Use cases

Hackflight has been tested on the following platforms:

To make it easy to develop flight firmware using Arduino-compatible microcontrollers, Hackflight is laid out as an Arduino library and uses the Arduino API; however, the core flight-control algorithm is hardware-independent.

Design principles

Hackflight attempts to maintain a simple relationship between the code and the elements of the flight-control dataflow diagram shown below. Boxes represent data, ovals represent functions, and feedback arrows represent the need for functions that have state (instance variables); for example, the maintenance of an error integral in a PID controller:

By using header-only C++ classes whenever possible, avoiding C-style macros and null pointers, and leveraging existing Arduino libraries for receivers, ESCs, and IMUs, Hackflight supports a composable approach to taming the complexity of flight control: you instantiate a Board subclass, passing it your IMU settings, PID controllers, mixer, ESC type, and LED pin number. In your loop function, you just call the step() method on the Board object, passing it the raw values from your IMU. Look at this example program to get an idea of how this approach works.

Desktop visualizer app

Because it is useful to get some visual feedback on things like vehicle orientation and RC receiver channel values, we also provide HFViz, a very simple visualizer program that allows you to connect to the board and see what's going on. Check out the HFViz README for more information.

Citing Hackflight

Please cite Hackflight as:

@ARTICLE{10.3389/fnbot.2020.00016,
AUTHOR={Levy, Simon D.},   
TITLE={Robustness Through Simplicity: A Minimalist Gateway to Neurorobotic Flight},      
JOURNAL={Frontiers in Neurorobotics},      
VOLUME={14},           
YEAR={2020},      
URL={https://www.frontiersin.org/articles/10.3389/fnbot.2020.00016},       
DOI={10.3389/fnbot.2020.00016},      
ISSN={1662-5218}
}

hackflight's People

Contributors

simondlevy avatar levyswluedu avatar juangallostra avatar akhazaee avatar pepms avatar alecsinger 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.