A virtual environment for testing drone control functions.
Showcase: https://youtu.be/FPFRh0Pat6M
- SFML library -
sudo apt-get install libsfml-dev
Run ./compile.sh
.
When running the compiled binary, you can use a few command line arguments:
-record
- record screen frame by frame into/frames/
folder-noscreen
- only render offscreen (useful when recording)-fps
- show FPS at the top right of the screen (wrong values when recording)
The main feature of this project is the Drone class. It handles both drone physics and rendering to the screen.
It can be found in src/
.
Variables:
x,y
- drone position in physics worldspeedx, speedy
- drone speed in physics worldangle
- drone angle in physics worldangular_velocity
- drone's angular velocity in physics worldinertia, mass, engine_dist, engine_pow
- drone properties
Functions:
Drone()
- constructorphysics()
- do a physics calculationsetPower()
- set engine powers for physics calculations
Rendering is done using SFML library.
Functions:
setColor()
- set drone colordraw()
- inherited from Drawable class, can be called for drawing on screen/textures