I recently bought DJI Tello which is essentially a DJI technology based drone developed by Ryze Tech a Schenzen based Company. The idea behind buying this drone was to explore how to use it in LearnOBots sessions where I teach kids about coding and technology. One of the first things I did was to fly the drone using it's android app. The second thing I did was to fly it by writing a program in the Go programming language.
According to its website Go is an open source programming language that makes it easy to build simple, reliable and efficient software. I chose it as GoBot can be used to easily program the DJI Tello. GoBot is a framework for robotics, physical computing and IoT writing in the Go programming language. GoBot supports a wide variety of devices including Arduino, BeagleBone, CHIP, DJI Spark and Tello, ESP8266, OpenCV, Raspberry PO, Sphero BB-8 and many many more.
So let's get started with this blog post about programming my DJI Tello with GoBot.
Step 1: Install Go:
You first need to install Go from the following link
Step 2: Installing GoBot
Then open up a command prompt or Terminal and type the following command to install GoBot tools
$ go get -d -u gobot.io/x/gobot/
Step 3: Connect to Tello
Turn on your Tello and connect to its WiFi. The WiFi will be named like TELLO-XXXX.
Step 4: Write your program
You can run the following example taken from the GoBot site. I use the Atom editor and save the file as tello.go. You can give it any name or extension. As long as you have Go installed, you should be able to run the Go program from the command line Terminal.
package main import ( "time" "gobot.io/x/gobot" "gobot.io/x/gobot/platforms/dji/tello" ) func main() { drone := tello.NewDriver("8888") work := func() { drone.TakeOff() gobot.After(5*time.Second, func() { drone.Land() }) } robot := gobot.NewRobot("tello", []gobot.Connection{}, []gobot.Device{drone}, work, ) robot.Start() }
Step 5: Run your program and fly the drone
Then go back to your Terminal (command prompt on windows) and run your Go Program by typing
Go run tello.py
Here is a video of the Test Flight
For full API reference you can visit
Hope you can buy and enjoy programming and flying your own Drone!
References:
No comments:
Post a Comment