Coding4Fun Drone posts
- Introduction to DJI Tello
- Analyzing Python samples code from the official SDK
- Drone Hello World ! Takeoff and land
- Tips to connect to Drone WiFi in Windows 10
- Reading data from the Drone, Get battery level
- Sample for real time data read, Get Accelerometer data
- How the drone camera video feed works, using FFMPEG to display the feed
- Open the drone camera video feed using OpenCV
- Performance and OpenCV, measuring FPS
- Detect faces using the drone camera
- Detect a banana and land!
- Flip when a face is detected!
Today code objective is very simple, based on a request I received from internet:
The drone is flying very happy, but if the camera detects a face, the drone will flip out !
Let’s take a look at the program working:
This one is very similar to the previous one. I also realized that I may need a better camera to record the live action side by side with the drone footage, but I think you get the idea. The command to make the drone flip is “flip x”, where “x” is the direction. In example:
"flip l" # flip left "flip r" # flip right "flip f" # flip forward "flip b" # flip back
Here is the code:
As I promised last time, in next posts, I’ll analyze more in details how this works, and a couple of improvements that I can implement.