A program that will do 3 things:
- Fly to drone to a set height first.
- Rotate until it finds a human face.
- Once found it will try to stay a certain distance from the face, even if you move back and forth.
Notably it uses DJITelloPy, yoloface and simple-pid. To Install every dependency run:
pip install -r requirements.txt
Connect to the drone's wifi and run:
python main.py
Make sure the enviroment is well illuminated, if you get "invalid imu" errors it's because the imu needs more light.
To land the drone after the program is running you can do a keyboard interrupt (Ctrl C).
The program is a implementation of the state machine below:
Every command to Tello is done with the DJITelloPy library. Yoloface is used to find the the face. A PID controller is used to mantain the distance from the face. The PID controller was tuned with PID Tuner and Implemented with simple-pid.