Tello EDU DRONE

This page introduces you to the Tello Edu Drone. here you can find information about the drone and tools we have designed for you to experiment with it.

You can finde more information about the drone here:

https://www.ryzerobotics.com/tello-edu


SETUP TELLO WITH P5JS With

  1. install the proxy

  • Download the udp to websocket proxy from the proxy folder below.

  • Start the proxy app.

  • Disable windows firewall. On macs port 9000 can cause problems.



To open the proxy on mac you need to rightclick on the app and press open.

2. Open p5js

We have made a p5js interface for you to program it. To use it you will need to do the following:

3. Start the tello drone

We have made a p5js interface for you to program it. To use it you will need to do the following:

  • Turn on the tello drone.

  • Choose the tello wifi on your laptop

  • Press the the run "arrow"

  • Press connect.

  • Now you should be able to control the drone.

Program the drone

Make a sequence of commands

Below is a simple example of how to make a drone show. It will take off, then go 30cm right, then go 30cm left, then land again:


droneCmd("takeoff", true);

droneCmd("right 30", true);

droneCmd("left 30", true);

droneCmd("land", true);

You can make different commands based on all the commands in the documentation. See below for the sdk pdf file. On the right there are few common ones.

Wrap it in the following to make a button:

if (uiButton("go left", color(0, 0, 0,0), 200, 200, 200, 30).clicked) {

droneCmd("left 30", true);

}

Make a controller with buttons

This code will place a button on the position 300,300 which send the right command to the drone when clicked:

if (uiButton(">>", color(255, 255, 255), 200, 30, 300, 300).clicked) {

droneCmd("right 30", true);

}

Make a controller with keypressed

if (keyIsPressed == true && key == 'a') {

a = -speed;

} else if (keyIsPressed == true && key == 'd') {

a = speed;

} else {

a = 0;

}


if (keyIsPressed == true && key == 'w') {

b = speed;

} else if (keyIsPressed == true && key == 's') {

b = -speed;

} else {

b = 0;

}

if (drones[0].queue.length < 1) {

droneCmd("rc " + a + " " + b + " " + c + " " + 0, false);

}

Get the drone to do something when it detects a mission pad

This code will change the screen to red when the drone detects a misison pad below. You need to turn on mission pad detection for it to work.

if(drones[0].getStateInfo("mid") == "2")

{

background(255,0,0);

}

The mission pad

The mission pads allows the drone to position itself relative to a certain mission pad. This will allow you to make sure the drone is place at a specific point in space. The pdf decribing the commands for a mission pad and how to use them is placed in the folder below. Also look we have created a few buttons in the interface for you to use to test it out.

Choose the pad you want to find. Then press go to pad. This will turn on mission pad mode and make it look for a mission pad.

if (uiButton("Do drone show", color(255, 255, 255), 200, 30, 40, 30).clicked) {

droneCmd("takeoff", true);

droneCmd("mon", true);

droneCmd("go 0 0 100 50 m-1", true);

droneCmd("forward 100", true);

droneCmd("go 0 0 0 50 m-7", true);

droneCmd("back 100", true);

droneCmd("go 0 0 0 50 m-1", true);

droneCmd("land", true);

}

Code explanation

In the following the different elements in the base sketch is explained:

wifiName and WifiPassword defines the wifi and password for the "Add to app button".

var wifiName = "fablab-droner";

var wifiPassword = "39nerdro";


This is the setup function that only runs once:

function setup() {

frameRate(30);

This creates the canvas and sets it to the size of the window:

const canvas = createCanvas(windowWidth, windowHeight);


Sets the defualt font used:

textFont('Share Tech Mono');

Settings for connecting to the proxy through a websocket and creates one drone.

WebSocketStart("ws://localhost:9000");

drones.push(new Drone("192.168.10.1"));

}



This is the function that draws the element and where you code the interactivity

function draw() {

It sets the background to black

background(0);

This calls a function that draws the drone ui

drawUI();

This code creates a button. When the button is clicked it sends four commands to the dorne queue to execute

if (uiButton("Do drone show", color(255, 255, 255), 200, 30, 40, 30).clicked) {

droneCmd("takeoff", true);

droneCmd("right 30", true);

droneCmd("left 30", true);

droneCmd("land", true);

}

}

Use this method if you want to register a mouse click

function mousePressed() {

}

Use this method to register keypresses - the first if statement registers when somebody presses the A button

function keyReleased() {

if (key == 'a') {

droneCmd("left 30", true);

}

if (key == 'f') {

var fs = fullscreen();

fullscreen(!fs);

}

}


Drone will not connect!

There are multiple reasons why the drone will not connect here is a list of things to be aware of:

  • If the drone is low on battery it might turn on but not connect.

  • You need to make sure that the port in the p5js sketch matches the port in the udp proxy.

  • You need to make sure that the ip is correct - if you connect directly to the dronews wifi the ip is: 192.168.10.1.

  • You need to make sure that no firewall is blocking your communication with the drone. Disable your firewall.

  • On windows you need to make sure that the wifi is private not public (see image on the left).

Documents and code

Below you can find the manuals on how to program the drone - which commands it can receive. Also you can finde the code for the processing version of the drone controller and the p5js source files.