Taking Flight with Code: DJI Tello Drone Open Source Fun

Check out the DJI Tello Drone! It’s a lightweight quadcopter that's perfect for anyone into coding and tech. There are tons of open-source projects on platforms like GitHub with libraries and tutorials that make it easy to get started. The Tello is super popular in schools, letting students explore programming, robotics, and computer vision through fun, hands-on projects. I actually coded and built a custom Graphical User Interface (GUI) for the Tello using Qt Creator and C++. Thanks to the DJI Tello API, my program comes packed with cool features. It includes an AI-powered video streaming module, which gives a real-time, high-quality video feed straight from the drone. The interface makes it easy to monitor the drone's connection, shows your location, and even grabs the current date and weather info. I also added precise flight controls, so you can fly the drone smoothly and accurately. Plus, it displays the drone's battery level, so you always know how much power you have left. This project shows how I combined C++ programming with the DJI Tello API to create a sleek, feature-rich interface for controlling the drone. 1



Tello DJI Open Source

                        
                            Italian Trulli

                            
                                
 





 

                        
                    
                                
                                    
                                        
  #include "tellocontroller.h"  #include opencv2/highgui/highgui.hpp 
#include iostream 
#include QDebug 

using namespace std; 
using namespace cv;

 
    TelloController::TelloController(QObject *parent)
    : QObject(parent)
{
    // Initialize your Tello object if necessary

    // Set up the connection check timer
    connectionTimer.setInterval(5000); // Check every 5 seconds
    connect(&connectionTimer, SIGNAL(timeout()), this, SLOT(checkConnection()));
    connectionTimer.start();
}

void TelloController::checkConnection()
{
    if (!DeadOp.is_connected()) {
        // Attempt to reconnect
        if (!DeadOp.connect("192.168.10.1", 8889)) {
            qWarning() << "Failed to Connect to Drone";
        }
        else {
            qCritical() << "Connection has been Established";

        }
    }
}

void TelloController::performDroneMovements()
{
    // Ensure the connection is established before sending commands
    if (DeadOp.is_connected()) {
        if (DeadOp.takeoff()) {
            std::cout << "deadOp has moved!\n";
            DeadOp.set_speed(20.0);
            DeadOp.move_right(70);
            DeadOp.move_forward(20);
            DeadOp.move_left(70);
            DeadOp.move_back(60);
            DeadOp.move_right(40);
            DeadOp.move_forward(40);
            DeadOp.move_left(20);
            DeadOp.land();
        }
    } else {
        std::cerr << "Tello drone not connected!" << std::endl;
    }
}