Programming the DJI Ryze Tello drone with Python

And … Action

To complete the picture of the DJI Ryze Tello's feature set, take a look at how you access the camera. To begin, you need to include the opencv-python library in the project. Proceed in the same way as described for the djitellopy library. The very powerful OpenCV [6] library provides extensive functions for image processing.

The program in Listing 4 opens the video stream from the camera and displays it in a new window. Note that the camera displays the many individual images quickly one after the other. To change the resolution of the images, remove the comment hash (#) at the start of line 8.

Listing 4

Video Stream

 

Good to Know

In testing, the DJI Ryze Tello turned out to be a light-loving device. If it is too dim in your office, the drone will not work properly and will constantly output messages like error No valid imu. In flight, the camera is used for navigation, and if the camera does not have enough light, the image becomes unusable.

As soon as you take a closer look at the Tello's camera, you will notice that image processing is computationally intensive, so reducing the resolution of the videos to counteract this problem is helpful. Often, even images with a considerably lower resolution are sufficient for further processing.

Nothing is more annoying than a drone that crashes because of a lack of power, so you should check the battery charge level in your program before each start and automatically exit the program if it is too low.

Conclusions

During this test, the drone suffered quite a few collisions with all sorts of objects in the office. Two propellers disappeared never to be seen again after a crash. A houseplant standing in the flight path was involuntarily cut back – and it's surprising how far shredded leaves fly.

During your first flight attempts, take meticulous care to remove any objects potentially standing around in the flight path area and fly the drone in as large a space as possible. At the end of the day, coming to grips with the DJI Ryze Tello and learning more about the little flying machine is massive fun. The only drawback of the compact drone is the relatively poor battery capacity, which will force you to take many breaks.

The Author

Martin Mohr has experienced the complete development of modern computer technology live. After completing university, he mainly developed Java applications. The Raspberry Pi helped him rediscover his old love of electronics.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • FOSSPicks

    After building a 3D printer last month, Graham's home is now filled with cup holders, phone holders, cable holders, and tiny PLA boats. This month, Graham explores Zrythm, Mumble 1.3, NoteKit, Kirogi, monolith, pastel, Nu Shell, PacVim, Stunt Car Racer Remake, and more!

  • Matt Trifiro on the Edge

    We talk with Matt Trifiro, one of the publishers of the State of the Edge report, on the nature of Edge computing and how it is changing IT.

  • Linux News

    Updates on Technologies, Trends, and Tools

  • Drone Brain Goes Open Source

    DARPA and NICTA release the code for the ultra-secure microkernel system used in aerial drones.

  • FOSSPicks

    This month Graham looks at Gyroflow, gRainbow, Polyrhythmix, mfp, Mission Center, and more!

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News