Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 2.63 KB

README.md

File metadata and controls

62 lines (50 loc) · 2.63 KB

Hackflight simulator instructions

  1. Install Webots on your computer.

  2. Add the following line to your ~/.bashrc file:

  export WEBOTS_HOME=/usr/local/webots
  1. From the hackflight main directory, do the following:
cd webots/plugins/physics/standard
make
cd ../../../controllers/standard
make
make run

If you have a game controller or R/C transmitter with adapter dongle, you can use that to fly; otherwise, the simulator will advise you that no such device was found and instruct you on how to fly with the keyboard. The following devices are currently supported:

Design principles

The basic time step in Webots is 32 milliseonds, which translates to an update rate of around 31 Hz in the control code (e.g., PID control). Although adequate for many robot applications, this rate is much slower than the typical rate of 500 - 1000 Hz used in actual flight controllers. Although it is possible to decrease the timestep in order to increase the update rate, there is as usual a tradeoff, in which a faster update rate can slow down the simulation. Fortunately, Webots supports custom physics plugins, in which you can replace Webots' built-in physics with a physics model of your own. The Hackflight simulator exploits this feature of Webots, using a dynamics model based on the equestions presented in this paper. The webots update step represents a slow, outer loop, in which is embeded a faster control loop, which in turn embeds an even faster dynamics loop. The following figure illustrates this arrangement, using a traditional cascade-control diagram: