Tello Dji
  • Introduction
  • Tech Spec
  • SDK
  • Frameworks
    • Python
      • Tellopy
      • PyTello
    • NodeJS
      • Tello-api-client
      • Tello-nodejs
    • Go
      • Gobot driver for the Ryze Tello
      • Tello Go (unofficial)
    • ROS
    • Scratch
    • Droneblocks
  • Applications
    • Requirements
    • FlyControll
      • Tellopy
        • HelloWorld
        • CircuitDemo
    • Image Recognition
      • Object Detection
    • Telemetry
      • HomeAssistant
      • BoschXDK110-RemoteController
        • Requirement
        • XDK110
        • Drone
Powered by GitBook
On this page

Was this helpful?

  1. Applications
  2. FlyControll
  3. Tellopy

HelloWorld

This application will help us to understand how to connect to Tello and also to start to interact with this drone.

// Import the libraries 
from time import sleep
import tellopy

// Define the handler of de drone, to detect when we have a flight event.
def handler(event, sender, data, **args):
   drone = sender
   if event is drone.EVENT_FLIGHT_DATA:
      print(data)

// Define our function that would help us to create our rutine, 
// First we subscribe to the handler, and then we connect to the drone.
// We need to wait for a connection and if not this would fail.
// We give the insturction of takeoff and land. 
def test():
   drone = tellopy.Tello()
   try:
      drone.subscribe(drone.EVENT_FLIGHT_DATA, handler)

      drone.connect()
      drone.wait_for_connection(60.0)
      drone.takeoff()
      sleep(5)
      drone.land()
      sleep(5)
   except Exception as ex:
      print(ex)
   finally:
      drone.quit()

if __name__ == '__main__':
   test()
PreviousTellopyNextCircuitDemo

Last updated 5 years ago

Was this helpful?